C# 执行bat批处理文件的小例子
程序员文章站
2024-02-20 15:33:16
复制代码 代码如下:private void runbat(string batpath){process pro = new process(); fileinfo fi...
复制代码 代码如下:
private void runbat(string batpath)
{
process pro = new process();
fileinfo file = new fileinfo(batpath);
pro.startinfo.workingdirectory = file.directory.fullname;
pro.startinfo.filename = batpath;
pro.startinfo.createnowindow = false;
pro.start();
pro.waitforexit();
}
上一篇: Mongoose初步认识(1)
下一篇: Object-C和Swift的区别