应用程序关闭时结束所有进程。

问题描述:

我已经构建了一个在浏览器中运行的asp.net应用程序

并使用httpWebRequest进行了大量的屏幕抓取和发布到各个网站的



httpWebResponse。我的应用程序循环遍历各种

URL,在指定的网站上执行各种工作。

当我在调试模式下中断应用程序时,所有

相关进程相应地停下来我设置了

调试选项,以便在休息时间为
命中时停止所有进程。但是,当我在

调试中结束应用程序时,一些错误的进程继续循环通过

我的URL并继续执行屏幕抓取

操作,即使调试会话没有

更长时间运行且资源管理器已关闭。

停止进程的唯一方法是杀死aspnet_wp.exe,或者手动

重启IIS。对于发生了什么的任何想法?

I have built an asp.net application that runs in explorer
and does a bunch of screen scraping and posting to
various websites using httpWebRequest and
httpWebResponse. My application loops through various
URLs, performing various jobs on specified websites.
When I break the application in debug mode, all
associated processes stop accordingly. I have set the
Debugging Option to stop all process when a break is
hit. However, when I end the application in the midst of
debugging, some errant process continues to loop through
my URLS and continue to perform screen scraping
operations, even though the debugging session is no
longer running and explorer has closed. The only way to
stop the process is to kill aspnet_wp.exe, or to manually
restart IIS. Any ideas of what is going on?

嗨大卫,


你的意思是什么?屏幕抓取进程,你是如何用线程启动

httpWebRequest的?


Luke

Microsoft在线支持


安全! www.microsoft.com/security

(此帖子按原样提供,不作任何保证,并且不授予

权利。)

Hi David,

What did you mean "screen scraping " process, and how did you start the
httpWebRequest, with threads?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


>

如果您使用线程,请确保将其IsBackground属性设置为

true。如果您正在使用system.diagnostics.Process启动一个过程

在退出代码之前终止所有过程。


Natty Gur [MVP]


博客: http://weblogs.asp.net/ ngur

手机:+ 972-(0)58-888377

***通过Developersdex发送 http://www.developersdex.com ***

不要只是参加USENET ...奖励它!
Hi,

if you are using threads ensure to set thier IsBackground property to
true. if you are using system.diagnostics.Process to start a process
Kill all the process before you exit your code.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


我实际上有两个单独的应用程序。在一个应用程序中,我生成了

线程来执行WebRequests。该应用程序展示了我之前提到的

行为。但是在我写的另一个应用程序中,我创建了WebRequest而没有生成线程。此应用程序

也显示相同的行为。


***通过Developersdex发送 http://www.developersdex.com ***

不要只是参加USENET ......获得奖励!
I actually have two separate applications. In one application I spawn
thread to perform the WebRequests. That application exhibits the
behavior I mentioned previously. However in another application I
wrote, I make the WebRequest WITHOUT spawning threads. This application
also shows the same behavior.

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!