示例#1
0
 public static NetProxy Create(string remoteAddress)
 {
     NetProxy session = null;
     var address = (remoteAddress ?? "").Split(':');
     if (address.Length > 1 && !address[0].StartsWith("http", StringComparison.CurrentCultureIgnoreCase))
     {
         session = new SocketNetProxy(address[0], Convert.ToInt32(address[1]));
     }
     else
     {
         session = new HttpNetProxy(remoteAddress);
     }
     return session;
 }
示例#2
0
        public static NetProxy Create(string remoteAddress)
        {
            NetProxy session = null;
            var      address = (remoteAddress ?? "").Split(':');

            if (address.Length > 1 && !address[0].StartsWith("http", StringComparison.CurrentCultureIgnoreCase))
            {
                session = new SocketNetProxy(address[0], Convert.ToInt32(address[1]));
            }
            else
            {
                session = new HttpNetProxy(remoteAddress);
            }
            return(session);
        }