예제 #1
0
 public RPCClient(string ipAddress, string strEndPoint, ProtocolSequenceType protocolSequence,
                  AuthenticationLevelType authenticationLevelType,
                  SecurityProviderType securityProviderType,
                  string userName, string password)
 {
     if (protocolSequence == ProtocolSequenceType.ncacn_np)
     {
         RPCWorker = new RPCWorker(ipAddress, strEndPoint, userName, password);
     }
     else if (protocolSequence == ProtocolSequenceType.ncacn_ip_tcp)
     {
         RPCWorker = new RPCWorker(ipAddress, int.Parse(strEndPoint), userName, password, authenticationLevelType, securityProviderType);
     }
     else
     {
         throw new Exception("no Support ProtocolSequenceType");
     }
     if (authenticationLevelType != AuthenticationLevelType.NONE && authenticationLevelType != AuthenticationLevelType.CONNECT && authenticationLevelType != AuthenticationLevelType.PKT)
     {
         throw new Exception("no Support authenticationLevelType");
     }
     if (securityProviderType != SecurityProviderType.NONE && securityProviderType != SecurityProviderType.WINNT)
     {
         throw new Exception("no Support SecurityProviderType");
     }
 }
예제 #2
0
        public RPCWorker(string strIpAddress, int destinationPort, string userName, string password, AuthenticationLevelType authenticationLevelType,
                         SecurityProviderType securityProviderType)
        {
            RpcTransport            = new RpcTransportOnTcp(strIpAddress, destinationPort);
            SecurityProviderType    = securityProviderType;
            AuthenticationLevelType = authenticationLevelType;

            if (SecurityProviderType == SecurityProviderType.WINNT)
            {
                NTLMClient = new NTLMClient();
            }
            UserName = userName;
            Password = password;
        }
예제 #3
0
 public static byte GetByte(this AuthenticationLevelType t)
 {
     return((byte)t);
 }
예제 #4
0
 public RPCWorker(string ipAddress, string strNamePipe, string userName, string password)
 {
     RpcTransport            = new RpcTransportOnPipe(ipAddress, strNamePipe, userName, password);
     SecurityProviderType    = SecurityProviderType.NONE;
     AuthenticationLevelType = AuthenticationLevelType.NONE;
 }