Xamarin表格文件永久上传卡住

时间:2019-06-26 10:00:56

标签: xamarin file-upload xamarin.forms

我的Xamarin表格文件上传代码不会转到下一条语句

WebClient client = new WebClient();
// add event listeners
client.UploadProgressChanged += Client_UploadProgressChanged;
client.UploadFileCompleted += Client_UploadFileCompleted;

// set the file type
client.Headers.Add("Content-Type", "application/zip");
// upload the file - tried below statements
var result = await Task.Run(async () => await client.UploadFileTaskAsync(UpLoadURL, "POST", File));//stucks here forever
await client.UploadFileTaskAsync(UpLoadURL, "POST", File);//tried this too
Console.WriteLine("Test");//this line does not get executed

0 个答案:

没有答案