停止httpwebrequest吗? [英] Stop a httpwebrequest?

查看:81
本文介绍了停止httpwebrequest吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在子目录中做了一个httpwebrequest.我的程序上的窗体有一个开始按钮,该按钮调用子程序.如果用户愿意,我想向其添加一个停止"按钮以停止httwebrequest.

I made a httpwebrequest in a sub. The form on my program has a start button which calls the sub. I want to add a Stop button to it to stop the httwebrequest if the user so chooses.

我该怎么做?

推荐答案

调用 Abort .

请注意,这可能会导致某些奇怪的行为……例如:根据您发出请求的方式以及它处于何种状态,这可能会导致死锁.

BEWARE that this might cause some strange behaviour... for example: depending on how you made the request and in what state it is this might lead to a deadlock.

这篇关于停止httpwebrequest吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆