string rs = "";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://2ip.ru/");
req.Method = "GET";
req.KeepAlive = true;
req.Headers.Add("Upgrade-Insecure-Requests", "1");
req.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36";
req.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8";
req.Headers.Add("Accept-Encoding", "gzip");
req.Headers.Add("Accept-Language", "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7");
req.Timeout = 10000;
HttpWebResponse response = (HttpWebResponse)req.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
rs = reader.ReadToEnd();
response.Close();