-4

So what i'm trying to do is really easy but i still can't find how to! This is my code :

wc.DownloadFile("My URI", @"\Workspace\ICSharpCode.AvalonEdit.dll");

I basically want to download a file and then save it in a folder that's located where my EXE is located. Thank you very much in advance for the help!

Stacknoob
  • 3
  • 2
  • 1
    What is not working with your current approach? What error are you receiving? – Kirk Woll May 27 '22 at 14:07
  • The path i have set is set at the disk root, i want it to be at the executable's root. – Stacknoob May 27 '22 at 14:11
  • `Path.Combine` is your friend – Poul Bak May 27 '22 at 14:33
  • 2
    Do these answer your question? [How to download a file from a URL in C#?](https://stackoverflow.com/questions/307688/how-to-download-a-file-from-a-url-in-c) and [How to write to a text file](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/file-system/how-to-write-to-a-text-file) – IVSoftware May 27 '22 at 14:34
  • It doesn't answer my question, and how does Path.Combine work ? – Stacknoob May 27 '22 at 15:18

0 Answers0