HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create("https://www.example.com");
NetworkCredential nc = new NetworkCredential("myname", "mypass");
WebProxy myproxy = new WebProxy("192.168.1.1:8080", false);
myHttpWebRequest.Proxy = myproxy;
myHttpWebRequest.Proxy = WebRequest.DefaultWebProxy;
myHttpWebRequest.Method = "GET";
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
MessageBox.Show("Ok");
이 코드를 사용하여 웹 사이트 (C# .net 데스크탑 응용 프로그램)에 연결합니다. 하지만 다음과 같은 오류 메시지가 표시됩니다.프록시 인증 오류
The remote server returned an error: (407) Proxy Authentication Required.
어떻게 해결할 수 있습니까?
Nc를 WebProxy 생성자로 전달해야합니까? – spb