Download a file over HTTP into a byte array in C#?

后端 未结 1 579
逝去的感伤
逝去的感伤 2020-12-09 02:13

I\'m trying to read a file that I have a web address for into a byte array. I\'ve been using File.ReadAllBytes to read files locally and I\'ve been unable to f

1条回答
  •  佛祖请我去吃肉
    2020-12-09 02:35

    byte[] response = new System.Net.WebClient().DownloadData(url);
    

    0 讨论(0)
提交回复
热议问题