如何用代码控制ADSL拨号?
linhl 2006-11-24 12:58:26 想用代码来控制ADSL拨号,断开连接代码如下:
dslProcess.StartInfo.Arguments = String.Format("/c rasdial {0} /DISCONNECT", raName);
try
{
adslProcess.Start();
adslProcess.WaitForExit();
}
catch (Exception ex)
{
throw ex;
}
finally
{
adslProcess.Close();
}
其中raName是拨号连接名,运行程序,有时可断开连接有时不能断开,但代码执行都顺利,没有出现异常,是什么问题?