刚才写了个笨办法,你看看:
string addr = Request.UserHostAddress; int index = addr.IndexOf(".", 0);
string firstAddr = addr.Substring(0, index); index++; int index2 = addr.IndexOf(".", index);
string secondAddr = addr.Substring(index, index2 - index); Response.Write(addr);
Response.Write("<br>");
Response.Write(firstAddr);
Response.Write("<br>");
Response.Write(secondAddr);
string addr = Request.UserHostAddress; int index = addr.IndexOf(".", 0);
string firstAddr = addr.Substring(0, index); index++; int index2 = addr.IndexOf(".", index);
string secondAddr = addr.Substring(index, index2 - index); Response.Write(addr);
Response.Write("<br>");
Response.Write(firstAddr);
Response.Write("<br>");
Response.Write(secondAddr);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货