【发布时间】:2013-05-19 16:19:40
【问题描述】:
所以我目前正在使用以下代码通过我的网络服务器上的 php 脚本上传文件:
string file = "dp.jpg";
System.Net.WebClient Client = new System.Net.WebClient();
Client.Headers.Add("Content-Type", "binary/octet-stream");
byte[] result = Client.UploadFile("http://localhost/upload.php", "POST", file);
String response = System.Text.Encoding.UTF8.GetString(result, 0, result.Length);
我想知道我将如何使用它,或者使用不同的方法来跟踪它已上传了多少并将其显示在进度条上?
谢谢。
【问题讨论】:
标签: c# upload progress-bar webclient