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;
            }
        }
    }
  • 相关阅读:
    Oracle表级约束和列级约束
    什么是SSL证书服务?
    什么是阿里云SCDN
    什么是阿里云CDN
    什么是弹性公网IP?
    什么是云解析DNS?
    什么是DataV数据可视化
    什么是大数据计算服务MaxCompute
    什么是文件存储NAS
    什么是云存储网关
  • 原文地址:https://www.cnblogs.com/goody9807/p/1298757.html
Copyright © 2011-2022 走看看