示例#1
0
        private async void btnSend_Click(object sender, EventArgs e)
        {
            if (grpConsole.InvokeRequired)
            {
                grpConsole.BeginInvoke(new MethodInvoker(delegate() { btnSend_Click(sender, e); }));
            }
            else
            {
                btnSend.Enabled = false;
                if (Client != null)
                {
                    Client.PacketType.Prompt    = txtPrompt.Text;
                    Client.PacketType.UsePrompt = rdoPromptEOL.Checked;

                    await Client.SendLineAsync(txtSend.Text);

                    txtSend.Text = null;
                }
                btnSend.Enabled = true;
            }
        }