Exemplo n.º 1
0
        void InitProxyClient()
        {
            clientProxy = new CoreSecurityClient("xxx");
            //clientProxy.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.None;
            // clientProxy.ChannelFactory.Credentials.Windows.ClientCredential.UserName = usr;
            //clientProxy.ChannelFactory.Credentials.Windows.ClientCredential.Password = pwd;
            ////clientProxy.ChannelFactory.Credentials.Windows.ClientCredential.Domain = domain;

            //clientProxy.ClientCredentials.UserName.UserName = usr;
            //clientProxy.ClientCredentials.UserName.Password = pwd;

            clientProxy.ClientCredentials.Windows.ClientCredential.UserName = txtUser.Text.Trim();
            clientProxy.ClientCredentials.Windows.ClientCredential.Password = txtPwd.Text.Trim();
            clientProxy.ClientCredentials.Windows.ClientCredential.Domain   = txtDomain.Text.Trim();
            if (chkUseProxy.Checked)
            {
                WebProxy proxy = new WebProxy(storage.StorageObject.ProxyAddress, false);
                proxy.Credentials          = new NetworkCredential(storage.StorageObject.ProxyUser, storage.StorageObject.ProxyPassword, storage.StorageObject.ProxyDomain);
                WebRequest.DefaultWebProxy = proxy;
            }
        }
Exemplo n.º 2
0
 void InitProxyClient2()
 {
     clientProxy2 = new CoreSecurityClient("xxx");
 }
Exemplo n.º 3
0
 void InitProxyClient2()
 {
     clientProxy2 = new CoreSecurityClient("xxx");
    
 }
Exemplo n.º 4
0
        void InitProxyClient()
        {
             clientProxy = new CoreSecurityClient("xxx");
            //clientProxy.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.None;
            // clientProxy.ChannelFactory.Credentials.Windows.ClientCredential.UserName = usr;
            //clientProxy.ChannelFactory.Credentials.Windows.ClientCredential.Password = pwd;
            ////clientProxy.ChannelFactory.Credentials.Windows.ClientCredential.Domain = domain;

            //clientProxy.ClientCredentials.UserName.UserName = usr;
            //clientProxy.ClientCredentials.UserName.Password = pwd;

            clientProxy.ClientCredentials.Windows.ClientCredential.UserName = txtUser.Text.Trim();
            clientProxy.ClientCredentials.Windows.ClientCredential.Password = txtPwd.Text.Trim();
            clientProxy.ClientCredentials.Windows.ClientCredential.Domain = txtDomain.Text.Trim();
            if (chkUseProxy.Checked)
            {
                WebProxy proxy = new WebProxy(storage.StorageObject.ProxyAddress, false);
                proxy.Credentials = new NetworkCredential(storage.StorageObject.ProxyUser, storage.StorageObject.ProxyPassword, storage.StorageObject.ProxyDomain);
                WebRequest.DefaultWebProxy = proxy;
            }
        }