您的位置:首页 > 其它

根据IP地址返回IP的详细信息(Web Service)

2012-08-30 15:18 363 查看
接口:http://www.sz3w.net/Service/GetIPArea.asmx?op=GetSignIPArea

protected void Button1_Click(object sender, EventArgs e)
{
int pagesize = Convert.ToInt32(PageSize.Text.ToString());
int pageindex = Convert.ToInt32(PageIndex.Text.ToString());
List<Vote> votes=DBHELP.QueryList(pagesize, pageindex);
if (votes != null)
{
ServiceIP.GetIPArea getip = new GetIPArea();

foreach (Vote v in votes)
{

string msg = getip.GetSignIPArea(v.IP);
if (msg.Substring(4, 2) == "-1")
{
v.IPaddress = "无效IP";
}
else
{
string[] strs = msg.Split('|');
v.IPaddress = strs[0].Substring(8) + strs[2].Substring(5);
}
DBHELP.DataUpdate(v);
}
Label1.Text = "执行完成!";
}
else
{
Label1.Text = "没有数据了!";
}
}


上述是我做的ip转ip详细的代码,部分看不懂关系,看关键代码就可以
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: