????? string url = @”http://www.input8.com/ip/?ip=59.38.240.54“;
??????????? HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
??????????? httpWebRequest.Method = “GET”;
??????????? HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
??????????? if (((int)httpWebResponse.StatusCode) >= 400)
??????????? {
?????????????? ????? return;
??????????? }
??????????? Stream responseStream = httpWebResponse.GetResponseStream();
??????????? StreamReader streamReader = new StreamReader(responseStream, Encoding.UTF8);
??????????? String result = streamReader.ReadToEnd().Trim();?? //result为得到的URL源码
??????????? httpWebResponse.Close();
??????????? streamReader.Close();