private void btnSendCommand_Click(object sender, EventArgs e)
        {
            try
            {
                lstStrings.Items.Clear();
                binaryData = null;

                txtResponse.Text = console.SendTextCommand(cmbxCommands.Text);

                // only receive strings if it's neccessary
                if (txtResponse.Text.Contains("202"))
                {
                    foreach (string resp in console.RecieveStrings())
                    {
                        lstStrings.Items.Add(resp);
                    }
                    lstStrings.Enabled = true;
                }
                else
                {
                    lstStrings.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
示例#2
0
 private void btnOpenTray_Click(object sender, EventArgs e)
 {
     console.SendTextCommand("dvdeject");
 }