2014-01-13 16 views
0

我知道,这个问题已经发布了几次,但我没有得到明确的答案/找到解决方案。我只是在使用SSL的网站上使用WebClient.DownloadString。每当我运行我的程序时,我都会收到“404未找到”错误。我在一个不使用SSL的网站上试用了我的程序,并且完美运行。如何在使用SSL的网站上使用WebClient.DownloadString?

这里是我的代码:

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

我想我的程序与使用SSL的网站兼容。有没有人有任何关于如何做到这一点的例子?谢谢,所有帮助表示赞赏。

回答

2

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