使用C#如何通过多线程处理cookie [英] Using C# how deal with cookie by multi-thread
本文介绍了使用C#如何通过多线程处理cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨朋友们:
现在,当我通过HttpWebRequest获取网络信息时,我遇到了一个问题。
当我使用线程获取Web信息时,不会生成此事。但是,使用多线程时会产生超时。我认为这应该是Cookie的问题,因为Cookie会在线程多线程上混乱。
你有答案吗? -----------------谢谢!!!
解决方案
我发现了解决方案!
我需要在最后一行之后添加一个httpWebRequest.Abort()来释放请求资源。
谢谢!!!
Hi friends:
Now, I meet a question when I get web information by HttpWebRequest.
The matter isn't produced when I use a thread to get web information. But, timeout will be produced when use multi-thread. I think that this should be Cookie matter, because Cookie will be messed on thread multi thread.
Do you have any answer? ----------------- Thanks!!!
解决方案
I found out resolution!
I need add a httpWebRequest.Abort() to release request resource after the last line.
Thanks!!!
这篇关于使用C#如何通过多线程处理cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文