启用VPN后,外部IP地址不会更改

 收藏

我的应用程序启动并自动运行一个线程,该线程每5秒运行一次

string urlAddress = "http://icanhazip.com/";

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlAddress);
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

            if (response.StatusCode == HttpStatusCode.OK)
            {
                Stream receiveStream = response.GetResponseStream();
                StreamReader readStream = null;

                if (String.IsNullOrWhiteSpace(response.CharacterSet))
                    readStream = new StreamReader(receiveStream);
                else
                    readStream = new StreamReader(receiveStream, Encoding.GetEncoding(response.CharacterSet));

                ip = readStream.ReadToEnd();

                response.Close();
                readStream.Close();
            }

运行vpn后,我的IP仍然是正常的,如何获得vpn分配的新IP?即使更改后,请求也是由同一ip发出的吗?

回复