外网IP当本地连接断开时如何控制
WebClient client = new WebClient();byte[] bytRecv = client.DownloadData("http://www.eyesoft.com.cn/ip.asp"); //下載數據
string str = System.Text.Encoding.GetEncoding("gb2312").GetString(bytRecv);
string r = @"(((\d{1,2})|(1\d{2})|(2[0-4]\d)|(25[0-5]))\.){3}((\d{1,2})|(1\d{2})|(2[0-4]\d)|(25[0-5]))$";
string ip = System.Text.RegularExpressions.Regex.Match(str, r).ToString(); //提取信息
this.label6.Text = ip.ToString();
这段是获取外网IP的代码,请各位大虾帮帮忙,如果本地连接断开的时候怎么控制呢?