tik4net.Api.ApiCommand.ExecuteNonQuery C# (CSharp) Метод

ExecuteNonQuery() публичный Метод

public ExecuteNonQuery ( ) : void
Результат void
        public void ExecuteNonQuery()
        {
            EnsureConnectionSet();
            EnsureNotRunning();

            _isRuning = true;
            try
            {
                string[] commandRows = ConstructCommandText(TikCommandParameterFormat.NameValue);
                IEnumerable<ApiSentence> response = EnsureApiSentences(_connection.CallCommandSync(commandRows));
                ThrowPossibleResponseError(response.ToArray());

                ApiSentence responseSentence = EnsureSingleResponse(response);
                EnsureDoneResponse(responseSentence);
            }
            finally
            {
                _isRuning = false;
            }
        }

Usage Example

Пример #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();
        }
All Usage Examples Of tik4net.Api.ApiCommand::ExecuteNonQuery