Tracking Progress of HTTPWebRequest
How can I track upload progress of HTTPWebRequest
? When I scattered Debug.WriteLines()
to track which parts of my code takes the longest time, i found out the function that took the longest time is
var res = req.GetResponse();开发者_Python百科
I could use BeginGetResponse()
but I have no way of tracking progress still? I read from various articles that I should track progress when writing to request stream, but I suppose that happens locally and thus is nearly instantaneous
With WebClient
, there is webClient.UploadProgressChanged
that allows me to track progress, but I think I can't use MultipartFormData
with that? And I can't have multiple uploads at once, not a really big deal tho, in my simple app
How can I then track upload/download progress with HTTPWebRequest
then?
you have events for tracking thins in the webclient
class
精彩评论