我正在使用“PUT”rest web 服务将文件上传到 One Drive。我使用了 webclient 的 UploadDataAsync 和 UploadStringAsync 方法。但在这两种情况下,UploadProgressChanged 事件仅在整个文件上传后才会触发。请建议。我需要在进度栏中显示上传操作的进度。
wc.UploadProgressChanged += new UploadProgressChangedEventHandler((sender, e) => webclient_UploadProgressChanged(sender, e, updateProgress));
wc.UploadStringCompleted += new UploadStringCompletedEventHandler(wc_UploadStringCompleted);
wc.UploadStringAsync(uriForUploading.Uri, "PUT", result);