zoukankan      html  css  js  c++  java
  • 一个webproxy代理类

    using System;
    using System.Net;
    using log4net;

    namespace Witty
    {
        public static class WebProxyHelper
        {
            private static Properties.Settings AppSettings = Properties.Settings.Default;
            private static readonly ILog logger = LogManager.GetLogger("Witty.Logging");

            public static IWebProxy GetConfiguredWebProxy()
            {
                WebProxy proxy = null;
                if (AppSettings.UseProxy)
                {
                    try
                    {
                        proxy = new WebProxy(AppSettings.ProxyServer, AppSettings.ProxyPort);
                        proxy.Credentials = new NetworkCredential(AppSettings.ProxyUsername, AppSettings.ProxyPassword);
                    }
                    catch (UriFormatException ex)
                    {
                        logger.Debug(ex.ToString());
                    }
                }
                return proxy;
            }
        }
    }
  • 相关阅读:
    阿里--面经 搜集
    阿里一面经验总结
    System对象
    JDBC-oracle(登陆)
    博客静态页面
    设计模式(1)---Factory Pattern
    软件设计师备考经验(含新旧版本对比)
    第九课,ROS仿真1
    参数服务器相关的问题
    3.空域图像处理的洪荒之力
  • 原文地址:https://www.cnblogs.com/goody9807/p/1298757.html
Copyright © 2011-2022 走看看