Ejemplo n.º 1
0
        public IWebClient GetWebClient(string url, string username, string password)
        {
            IWebClient webClient;

            var cruiseAddress = new CruiseAddress(url);
            if (cruiseAddress.IsDebug)
            {
                webClient = new SandboxWebClient();
            }
            else
            {
                webClient = new HttpWebClient(username, password);
            }

            _log.InfoFormat("Using WebClient->[{0}]", webClient.GetType());
            return webClient;
        }
Ejemplo n.º 2
0
        public IWebClient GetWebClient(string url)
        {
            IWebClient webClient;

            var uri = new UrlParser(url);
            if (uri.IsDebug)
            {
                webClient = new SandboxWebClient();
            }
            else
            {
                webClient = new HttpWebClient(new Uri(uri.Url));
            }

            _log.DebugFormat("Using WebClient: {0}", webClient.GetType());
            return webClient;
        }
Ejemplo n.º 3
0
        public IWebClient GetWebClient(string url)
        {
            IWebClient webClient;

            var uri = new UrlParser(url);

            if (uri.IsDebug)
            {
                webClient = new SandboxWebClient();
            }
            else
            {
                webClient = new HttpWebClient();
            }

            _log.DebugFormat("Using WebClient: {0}", webClient.GetType());
            return(webClient);
        }