C#如何使用NTLM Authtification设置Webproxy

时间:2017-09-04 14:31:23

标签: c# webclient webproxy defaultnetworkcredentials ntlm-authentication

我想建立一个带有NTLM身份验证代理的webclient,但我有一些问题需要移交DefaultCredentials。这是我目前的解决方案,但它不起作用。

        textBox.Text = "";
        IWebProxy proxy = System.Net.WebRequest.DefaultWebProxy;
        proxy.Credentials = CredentialCache.DefaultCredentials;
        WebClient client = new WebClient
        {
            Proxy = proxy
        };
        client.Credentials = CredentialCache.DefaultCredentials;
        textBox.Text = client.DownloadString("http://www.google.com");

以下是我阅读的一些引用链接,但对我来说没有任何作用:

How should I set the default proxy to use default credentials?

C# Connecting Through Proxy

你有什么想法解决这个问题吗?

0 个答案:

没有答案