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;
        }
Esempio 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;
        }