-1

kinda new to programming and trying to write a sample program and this is the line generating the error

var bytes = File.ReadAllBytes(@"http://localhost/test.exe");

error is Unhandled Exception: System.ArgumentException: URI formats are not supported

A local path works but this isn't what i'm trying to do. Need to fetch from http or ftp Trying to keep it lean and clean - let me know what ideas you might have Could someone please give me code to paste in to replace/fix this line so that it will compile

tried various things but can't make it work without using a local path

  • 1
    Does this answer your question? [How can I download a file from a URL in C#?](https://stackoverflow.com/questions/307688/how-can-i-download-a-file-from-a-url-in-c) – Martheen Aug 12 '23 at 02:15

0 Answers0