ExecuteNonQuery() public method

public ExecuteNonQuery ( ) : void
return void
Exemplo n.º 1
0
        private void Login(string user, string password)
        {
            //Get login hash
            ApiCommand readLoginHashCommand = new ApiCommand(this, "/login");
            string     responseHash         = readLoginHashCommand.ExecuteScalar();

            //login connection
            string     hashedPass   = ApiConnectionHelper.EncodePassword(password, responseHash);
            ApiCommand loginCommand = new ApiCommand(this, "/login", TikCommandParameterFormat.NameValue,
                                                     new ApiCommandParameter("name", user), new ApiCommandParameter("response", hashedPass));

            loginCommand.ExecuteNonQuery();
        }
Exemplo n.º 2
0
        public void Open(string host, int port, string user, string password)
        {
            //open connection
            _tcpConnection = new TcpClient();
            _tcpConnection.Connect(host, port);
            _tcpConnectionStream = _tcpConnection.GetStream();

            //Get login hash
            ApiCommand readLoginHashCommand = new ApiCommand(this, "/login");
            string     responseHash         = readLoginHashCommand.ExecuteScalar();

            //login connection
            string     hashedPass   = ApiConnectionHelper.EncodePassword(password, responseHash);
            ApiCommand loginCommand = new ApiCommand(this, "/login", TikCommandParameterFormat.NameValue,
                                                     new ApiCommandParameter("name", user), new ApiCommandParameter("response", hashedPass));

            loginCommand.ExecuteNonQuery();

            _isOpened = true;
        }
Exemplo n.º 3
0
 private bool CancelInternal(bool joinLoadingThread, int milisecondsTimeout)
 {
     if (_isRuning && _runningTag >= 0)
     {
          ApiCommand cancellCommand = new ApiCommand(_connection, "/cancel", new ApiCommandParameter(TikSpecialProperties.Tag, _runningTag.ToString())); //REMARKS: =tag=1234 and not =.tag=1234
          cancellCommand.ExecuteNonQuery();
         if (joinLoadingThread)
         {
             Thread loadingThread = _asyncLoadingThread;
             if (loadingThread != null)
             {
                 if (milisecondsTimeout > 0)
                     return loadingThread.Join(milisecondsTimeout);
                 else
                 {
                     loadingThread.Join();
                     return true;
                 }
             }
         }
     }
     return true;
 }
Exemplo n.º 4
0
        public void Open(string host, int port, string user, string password)
        {
            //open connection
            _tcpConnection = new TcpClient();
            _tcpConnection.Connect(host, port);
            _tcpConnectionStream = _tcpConnection.GetStream();

            //Get login hash
            ApiCommand readLoginHashCommand = new ApiCommand(this, "/login");
            string responseHash = readLoginHashCommand.ExecuteScalar();

            //login connection
            string hashedPass = ApiConnectionHelper.EncodePassword(password, responseHash);
            ApiCommand loginCommand = new ApiCommand(this, "/login", TikCommandParameterFormat.NameValue,
                new ApiCommandParameter("name", user), new ApiCommandParameter("response", hashedPass));
            loginCommand.ExecuteNonQuery();

            _isOpened = true;
        }
Exemplo n.º 5
0
        private void Login(string user, string password)
        {
            //Get login hash
            ApiCommand readLoginHashCommand = new ApiCommand(this, "/login");
            string responseHash = readLoginHashCommand.ExecuteScalar();

            //login connection
            string hashedPass = ApiConnectionHelper.EncodePassword(password, responseHash);
            ApiCommand loginCommand = new ApiCommand(this, "/login", TikCommandParameterFormat.NameValue,
                new ApiCommandParameter("name", user), new ApiCommandParameter("response", hashedPass));
            loginCommand.ExecuteNonQuery();
        }
Exemplo n.º 6
0
 public void Cancel()
 {
     if (_isRuning && _runningTag >= 0)
     {
         ApiCommand cancellCommand = new ApiCommand(_connection, "/cancel", new ApiCommandParameter(TikSpecialProperties.Tag, _runningTag.ToString())); //REMARKS: =tag=1234 and not =.tag=1234
         cancellCommand.ExecuteNonQuery();
     }
 }