.NET客户端应用程序:如何在案件代理到达Web服务? [英] .NET client app: how to reach Web Services in case of proxy?

查看:102
本文介绍了.NET客户端应用程序:如何在案件代理到达Web服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个.NET 2.0的WinForm程序。该应用程序需要访问 Web服务。然而,我们所遇到的问题背后代理的用户。

We are developing a .NET 2.0 winform application. The application needs to access Web Services. Yet, we are encountering issues with users behind proxies.

流行的Windows备份程序(认为 Mozy的)所提供的是中等复杂程度的对话窗口专门的代理服务器设置。然而,重新实施尚未另一代理处理逻辑和GUI看起来的浪费时间在我身上。

Popular windows backup applications (think Mozy) are providing a moderately complex dialog window dedicated the proxy settings. Yet, re-implementing yet-another proxy handling logic and GUI looks a total waste of time to me.

什么是处理与.NET客户端应用程序代理最好的方法是什么?

What are best ways to deal with proxy with .NET client apps?

更具体地讲,我们在用户已经记录了他在Internet Explorer中的代理服务器设置(包括用户名和密码)的情况下,使.NET的的默认的代理行为的应该工作。然而,用户仍然提示输入自己的用户名和密码启动IE时(这两个领域是pre-完成,用户只需要点击OK) - 和我们的WinForm应用程序仍然未能在处理代理

More specifically, we have a case where the user has recorded his proxy settings in Internet Explorer (including username and password), so the default proxy behavior of .NET should work. Yet, the user is still prompted for his username and password when launching IE (both fields are pre-completed, the user just need to click OK) - and our winform application still fails at handling the proxy.

我们应该做些什么来执行未提示输入自己的用户名和密码的用户启动IE时?

What should we do to enforce that the user is not prompted for his username and password when launching IE?

推荐答案

在应用程序的配置文件将这个:

Put this in your application's config file:

<configuration>
  <system.net>
    <defaultProxy>
      <proxy autoDetect="true" />
    </defaultProxy>
  </system.net>
</configuration>

和您的应用程序将使用代理服务器设置的IE浏览器。如果可以使用代理服务器看到您的Web服务在IE浏览器,你应该能够从你的应用程序看到它。

and your application will use the proxy settings from IE. If you can see your web service in IE using the proxy server, you should be able to "see" it from your application.

这篇关于.NET客户端应用程序:如何在案件代理到达Web服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆