• web.config文件中的<default proxy> 的知识


    这个元素指定了HTTP请求Internet资源时使用的代理服务器.

    <configuration>
    
        <system.net>
    
            <defaultProxy>

    <defaultProxy>元素定义了被GlobalProxySelection类使用的代理服务器信息. 任何没有制定代理属性的HttpRequest都会使用由defaultProxy定义的代理.

    总的来说, 标准桌面应用程序中, .NET运行时会使用由Microsoft Internet Explorer中的代理服务器配置. 如果你访问你的web service存在的站点, 那么你就能够不修改任何配置地用.NET运行时来进行访问, 因为你的配置是从你的user profile中获取的.

    .NET运行时并不支持自动探测代理的服务的脚本. 如果IE浏览器使用自动配置这个选项来确定HTTP代理配置, 你就能够手动地在machine.config文件中, 配置全局的HTTP代理配置. 同样地, 当你在没有加载user profile的情况下, 使用.NET运行时来访问一个XML web service(比如说, 你从一个ASP.NET页面调用web service), 你就必须在machine.config中进行配置.

    To configure the HTTP proxy settings for desktop and ASP.NET applications, follow these steps:

    1. Edit the Machine.config file. For the .NET Framework, the default location for this file is C:\WINNT\Microsoft .NET\Framework\v1.0.2914\CONFIG\machine.config.
    2. Locate the \configuration\system.net\defaultProxy element in the XML.
    3. Change the child <proxy> element to the following, where http://myproxyserver indicates your HTTP proxy server:

      <proxy usesystemdefault="false" 
             proxyaddress="http://myproxyserver" 
             bypassonlocal="true" /> 
      						

      The bypassonlocal attribute indicates that requests to hosts whose names contain a period (.) should not be sent through the proxy.

    4. If other addresses need to bypass the proxy server, you can add them by creating a <bypasslist> element as a child of the <defaultProxy> element. The <bypasslist> syntax should resemble the following:

      <bypasslist>
          <add address="localdomain.com|localdomain2.com" />
      </bypasslist> 
      						

      This syntax avoids sending any requests to localdomain.com and localdomain2.com through the HTTP proxy. The address attribute is actually a string that contains a regular expression. For more information on the syntax of regular expressions, see the information on System.Text.RegularExpresions in the .NET runtime documentation.

    5. Save the changes to Machine.config and restart the application.

    http://support.microsoft.com/kb/307220/

    http://msdn.microsoft.com/en-us/library/aa903360%28VS.71%29.aspx

  • 相关阅读:
    css中的display以及position属性
    有人退税近4000元!个税年度汇算开始了,看看你能退多少?
    多维竞争
    阿里智能化接口测试平台--暴雪
    盗版网课有多猖狂?原价上万,只卖5元
    测试找BUG总结
    女程序员做了个梦。。。
    混沌的市场里,怎么一眼识别出「好房子」
    知乎扎心高赞:30岁还没有走到管理岗的人,后来怎么样了?
    自动化是在敏捷中提供连续测试的唯一方法
  • 原文地址:https://www.cnblogs.com/awpatp/p/1645087.html
Copyright © 2020-2023  润新知