C#d调用外部bat
引入名称空间:
using System.Diagnostics;
Process proc = null;
try
{
string targetDir = string.Format(@"D:/BATFile/");//this is where testChange.bat lies
proc = new Process();
proc.StartInfo.WorkingDirectory = targetDir;
proc.StartInfo.FileName = "Video.bat";
proc.StartInfo.Arguments = string.Format("20");
//proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;//这里设置DOS窗口不显
C#d调用外部bat最先出现在Python成神之路。
共有 0 条评论