我正在使用波纹管代码来了解客户端IP,但它正在给我的服务器ip,请有人进行必要的更改,如果有的话,
提前致谢,
protected string GetComputer_InternetIP()
{
// check IP using DynDNS's service
WebRequest request = WebRequest.Create("http://checkip.dyndns.org");
WebResponse response = request.GetResponse();
StreamReader stream = new StreamReader(response.GetResponseStream());
// IMPORTANT: set Proxy to null, to drastically INCREASE the speed of request
//request.Proxy = null;
// read complete response
string ipAddress = stream.ReadToEnd();
// replace everything and keep only IP
return ipAddress.
Replace("<html><head><title>Current IP Check</title></head><body>Current IP Address: ", string.Empty).
Replace("</body></html>", string.Empty);
}