开发者

Call multiple HttpWebRequest

I need to开发者_开发技巧 do several HttpWebRequest requests in a single moment, but when I make the request several times will cost a lot of time. I plan on doing each request in a separate thread and then get all the returns and put it all together when all calls are completed is it possible?


Absolutely.

Take a look at the msdn docs on HttpWebRequest.BeginGetResponse Method

I couldn't write a better example than in the docs.


I don't know much about Threading, but as they run asynchronously, getting a return value isn't an option. However, this thread : http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/c43c0cce-491a-4ddb-9012-69929fab8e5e/ does point towards the ThreadPool class.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜