Exemple #1
0
        private static IOWebClient CreateWebClient(IOConnectionInfo ioc)
        {
            PrepareWebAccess(ioc);

            IOWebClient wc = new IOWebClient(ioc);

            if ((ioc.UserName.Length > 0) || (ioc.Password.Length > 0))
            {
                wc.Credentials = new NetworkCredential(ioc.UserName, ioc.Password);
            }
            else if (MonoWorkarounds.IsRequired(688007))
            {
                wc.Credentials = new NetworkCredential("anonymous", string.Empty);
            }

            ConfigureWebClient(wc);
            return(wc);
        }
Exemple #2
0
        private static IOWebClient CreateWebClient(IOConnectionInfo ioc)
        {
            PrepareWebAccess(ioc);

            IOWebClient wc = new IOWebClient(ioc);

            ConfigureWebClient(wc);

            if ((ioc.UserName.Length > 0) || (ioc.Password.Length > 0))
            {
                wc.Credentials = new NetworkCredential(ioc.UserName, ioc.Password);
            }
            else if (NativeLib.IsUnix())            // Mono requires credentials
            {
                wc.Credentials = new NetworkCredential("anonymous", string.Empty);
            }

            return(wc);
        }