国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
C#中執(zhí)行批處理文件(*.bat)的方法代碼
本文介紹一下在C#中執(zhí)行批處理文件(*.bat)的方法。

復(fù)制代碼 代碼如下:

static void Main(string[] args)
{
    Process proc = null;
    try
    {               
        string targetDir = string.Format(@"D:\adapters\setup");//this is where mybatch.bat lies
        proc = new Process();
        proc.StartInfo.WorkingDirectory = targetDir;
        proc.StartInfo.FileName = "mybatch.bat";
        proc.StartInfo.Arguments = string.Format("10");//this is argument
        proc.StartInfo.CreateNoWindow = false;
        proc.Start();
        proc.WaitForExit();
    }
    catch (Exception ex)
    {
        Console.WriteLine("Exception Occurred :{0},{1}", ex.Message,ex.StackTrace.ToString());
    }
}

如果要運(yùn)行時(shí)隱藏dos窗口,需使用下面的代碼

復(fù)制代碼 代碼如下:

proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
使用c#實(shí)現(xiàn)dsoframer.ocx的注冊(cè)方法
C#讀取.sql文件并執(zhí)行文件中的sql
Java調(diào)用可執(zhí)行文件和批處理命令
c#運(yùn)行批處理文件
aardio + bat 批處理混合編程,制作漂亮圖形界面
批處理文件中獲取批處理文件路徑的方法
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服