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;
            }
        }
    }
  • 相关阅读:
    团队项目-需求分析报告
    团队项目-选题报告
    第一次结对编程作业
    第一次编程作业
    第一次作业
    第10组 Beta冲刺(2/4)
    第10组 Beta冲刺(1/4)
    第10组 Alpha冲刺(4/4)
    第10组 团队Git现场编程实战
    第二次结对编程作业
  • 原文地址:https://www.cnblogs.com/goody9807/p/1298757.html
Copyright © 2011-2022 走看看