110,567
社区成员
发帖
与我相关
我的任务
分享
WebClient client = new WebClient();
var text = client.DownloadString("http://www.ip.cn/getip2.php?action=getip")
.Replace("</span> 来自:", " ")
.Replace("<span class='orange'>", string.Empty);
var sp = text.Split(' ');
if(sp.Length == 3)
{
_client = new ClientInfo();
_client.Address = sp[0].Trim();
_client.From = sp[1].Trim();
_client.Netline = sp[2].Trim();
lLineDisplay.Text = _client.From + "\r\n" + _client.Address + " " + _client.Netline;
radioGroup1.EditValue = _client.GetRemotingAddress();
}