afsal ks

afsal ks

  • NA
  • 4
  • 785

how to fetch com port details from cmd result

Jan 23 2020 11:19 AM
 
need code for only "COM8" into a string COM8 may be change according our com port change
  1. private void button21_Click(object sender, EventArgs e)  
  2. {  
  3. try  
  4. {  
  5. edltext.Clear();  
  6. startInfo.FileName = "emmcdl.exe";  
  7. startInfo.Arguments = " -l";  
  8. process.StartInfo = startInfo;  
  9. process.Start();  
  10. edltext.Text = edltext.Text + "\r\n" + process.StandardOutput.ReadToEnd();  
  11. }  
  12. catch (Exception ex)  
  13. {  
  14. edltext.Text = (ex.Message);  


Answers (1)