获得外网IP(偷资源)

private string getByIp()
{
string strUrl = "http://iframe.ip138.com/ic.asp"; //获得IP的网址了
WebClient w = new WebClient();
Stream s= w.OpenRead(strUrl);
int i = 0;
string str = "";
do
{
i = s.ReadByte();
if (i > 0)
str += Convert.ToChar(i);
}
while (i > 0);
int ii = str.IndexOf('[');
string strstr = "";
string strss = "";
if (ii != -1)
{
for (int k = ii+1; k < str.Length - 1; k++)
{
strstr += str[k];
}
string[] ss= strstr.Split('.');
for (int j = 0; j < ss.Length ; j++)
{
if (j == 3)
{
strss += ss[j].Split(']')[0];
}
else
{
strss += ss[j] + ".";
}
}
}
return strss;
}

 

成都创新互联10多年企业网站制作服务;为您提供网站建设,网站制作,网页设计及高端网站定制服务,企业网站制作及推广,对PVC花箱等多个方面拥有丰富设计经验的网站建设公司。


分享名称:获得外网IP(偷资源)
浏览地址:http://pwwzsj.com/article/pogjih.html