コード例 #1
0
        public void dropUser()
        {
            // Get username
            string username;

            Console.WriteLine("\nEnter username:"******"\nINFO: User dropped\n");
            }
            else
            {
                Console.WriteLine("ERROR: User not found!");
            }
        }
コード例 #2
0
        private void DropUserClicked(object sender, EventArgs e)
        {
            try
            {
                int row = gridUsers.CurrentRow.Index;

                if (row >= 0)
                {
                    string       username = users[row].name;
                    DialogResult result   = MessageBox.Show("Drop user " + username + "?", "Confirm Drop", MessageBoxButtons.YesNo);

                    if (result == DialogResult.Yes)
                    {
                        client.DropUser(null, username);
                        ReadUsers(null);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }