有時htmlDocument.Load(URL)給了我這個異常:不能趕上HTMLDocument的負載例外
Unhandled Exception: System.IO.IOException: Unable to read data from the transpo
rt connection: An existing connection was forcibly closed by the remote host. --
不幸的是,我不能捕獲這個異常。
我捕捉到了異常如下:
try
{
page = web.Load(url + Convert.ToString(i + 1) + "/");
}
catch (ArgumentException ex)
{
//do something
}
當我運行該程序,異常仍停在那裏行寫程序:
page = web.Load(url + Convert.ToString(i + 1) + "/");
有人能幫助我嗎?