Có Code nào mà có thể chạy được lệnh CMD khi Click vào Button không ạ? Tức là khi Tick vào RadioButton và Click vào Button thì nó sẽ chạy Code đó và mỗi RadioButton thì nó sẽ chạy Code khác không ạ?
// khai bao lop thu vien
using System.Diagnostics;
// khoi tao tien trinh
Process process = new Process();
// thiet lap thong so tien trinh
process.StartInfo.FileName = "cmd.exe"; // đường dẫn chương trình
process.StartInfo.Arguments = "/k {duong dan file cmd/bat hoac lenh cmd}"; // tham so
process.StartInfo.UseShellExecute = false; // tat giao dien
process.StartInfo.CreateNoWindow = true; // tat tao cua so moi
process.StartInfo.RedirectStandardOutput = true; // xuat du lieu tieu chuan
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; // an cua so
// chay tien trinh
process.Start();
// doc du lieu tra lai cua chuong trinh
// Stream data = process.StandardOutput.BaseStream;