【问题标题】:WebClient call works in WinXP but not on Win7WebClient 调用在 WinXP 中有效,但在 Win7 中无效
【发布时间】:2012-06-12 06:09:54
【问题描述】:

以下调用在 WinXP 中返回结果,但在 Win7 中不返回:

 using (WebClient client = new WebClient())
            {
                var result = client.DownloadString("https://secure.plimus.com/jsp/validateKey.jsp");
            }

我得到“System.Net.WebException:操作已超时”异常

我做错了什么?

【问题讨论】:

  • 在什么情况下不起作用?你有例外吗?
  • 我得到“System.Net.WebException:操作超时”异常
  • 我认为它可以在 Windows 7 的浏览器中运行?
  • 不,桌面 WinForms 应用程序中的 C# 代码。
  • 康奈尔,我想肯尼的意思是;您是否尝试过在同一台 PC 上的网络浏览器(IE、Chrome 等)中浏览到该 URL?发生什么了?可以连接吗?

标签: c# .net windows-7 bluesnap


【解决方案1】:

您应该尝试查看 System.Net 跟踪是否可以为您提供有关连接尝试的更多信息,

http://blogs.msdn.com/b/asiatech/archive/2009/04/08/using-system-net-trace-to-troubleshooting-ssl-problem-in-net-2-0-application.aspx

最好从 Windows XP 和 Windows 7 中收集跟踪文件。比较它们,你就会发现原因。

【讨论】:

    猜你喜欢
    • 2014-07-10
    • 1970-01-01
    • 2020-04-06
    • 1970-01-01
    • 1970-01-01
    • 2021-11-02
    • 2013-08-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多