-1
Good Afternoon, I’m a beginner in C# and I’ve already looked for this answer here on the internet and I didn’t find it at all, I’m working with C# and windows Forms, I have a folder inside my application called img and I have a pdf file inside it, I would like when the customer clicks on the button he downloads that pdf file to the client’s computer downloads folder. How can I do that? I’ve tried everything and I can’t.
//Baixar Pdf
private void toolStripButton11_Click(object sender, EventArgs e)
{
this.DownloadFile("img\\Ajuda.pdf", "Ajuda.pdf");
}
mto thanks, this solution already solves my problem.
– Joana
you could tell me how I do to check if the file already exists in the download folder?
– Joana
@Joana Use o File.Exists https://docs.microsoft.com/en-us/dotnet/api/system.io.file.exists?view=net-5.0
– isaque
I used as the code shows, but as my folder is "Donwloads" and does not have the C: in front it does not recognize the folder...
– Joana
@Joana final adjustmentPath as needed. See: https://www.codeproject.com/Articles/878605/Getting-all-Special-Folders-in-NET
– isaque
Valew got now with this last tip, mto thanks msm :)
– Joana