C# 如何在使用SSL的网站上使用WebClient.DownloadString?

C# 如何在使用SSL的网站上使用WebClient.DownloadString?,c#,webclient,C#,Webclient,我知道,这个问题之前已经发布过好几次了,但我没有得到明确的答案/找到解决方案。我只是在使用SSL的网站上使用WebClient.DownloadString。每当我运行我的程序,我会得到一个“404未找到”错误。我在一个不使用SSL的网站上试用了我的程序,效果非常好 这是我的密码: System.Net.WebClient webClient = new System.Net.WebClient(); string webData = webClient.DownloadString("http

我知道,这个问题之前已经发布过好几次了,但我没有得到明确的答案/找到解决方案。我只是在使用SSL的网站上使用WebClient.DownloadString。每当我运行我的程序,我会得到一个“404未找到”错误。我在一个不使用SSL的网站上试用了我的程序,效果非常好

这是我的密码:

System.Net.WebClient webClient = new System.Net.WebClient();
string webData = webClient.DownloadString("https://example.com?user=" + listBox1.Items[currentIndex]);

我正在尝试使我的程序与使用SSL的网站兼容。有没有人举过这样的例子?谢谢,非常感谢您的帮助。

System.Net.WebClient.DownloadString()支持使用SSL的网站。如果服务器返回404错误,则表示您请求的资源不存在,或者web服务器配置不正确,无法根据需要处理SSL请求