Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何直接从 url 上传文件而不下载并将其上传到服务器?
就像我有链接一样
http://whatever/test.pdf
将其放入文本框并上传!
使用System.Net.WebClient:
System.Net.WebClient
var url = textBox1.Text; var client = new System.Net.WebClient(); client.DownloadFile(url, "c:\\path-to-save-file-on-server\\test.pdf");