久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <i id='BlwBF'><tr id='BlwBF'><dt id='BlwBF'><q id='BlwBF'><span id='BlwBF'><b id='BlwBF'><form id='BlwBF'><ins id='BlwBF'></ins><ul id='BlwBF'></ul><sub id='BlwBF'></sub></form><legend id='BlwBF'></legend><bdo id='BlwBF'><pre id='BlwBF'><center id='BlwBF'></center></pre></bdo></b><th id='BlwBF'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BlwBF'><tfoot id='BlwBF'></tfoot><dl id='BlwBF'><fieldset id='BlwBF'></fieldset></dl></div>
    <tfoot id='BlwBF'></tfoot>

    <small id='BlwBF'></small><noframes id='BlwBF'>

    • <bdo id='BlwBF'></bdo><ul id='BlwBF'></ul>

  1. <legend id='BlwBF'><style id='BlwBF'><dir id='BlwBF'><q id='BlwBF'></q></dir></style></legend>
    1. 如何調(diào)用帶有參數(shù)的外部程序?

      How to call an external program with parameters?(如何調(diào)用帶有參數(shù)的外部程序?)

      • <bdo id='6skWF'></bdo><ul id='6skWF'></ul>
        <legend id='6skWF'><style id='6skWF'><dir id='6skWF'><q id='6skWF'></q></dir></style></legend><tfoot id='6skWF'></tfoot>
                <tbody id='6skWF'></tbody>
              <i id='6skWF'><tr id='6skWF'><dt id='6skWF'><q id='6skWF'><span id='6skWF'><b id='6skWF'><form id='6skWF'><ins id='6skWF'></ins><ul id='6skWF'></ul><sub id='6skWF'></sub></form><legend id='6skWF'></legend><bdo id='6skWF'><pre id='6skWF'><center id='6skWF'></center></pre></bdo></b><th id='6skWF'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6skWF'><tfoot id='6skWF'></tfoot><dl id='6skWF'><fieldset id='6skWF'></fieldset></dl></div>
            • <small id='6skWF'></small><noframes id='6skWF'>

                本文介紹了如何調(diào)用帶有參數(shù)的外部程序?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我想使用代碼本身確定的參數(shù)在我的代碼中調(diào)用 Windows 程序.

                I would like to call a windows program within my code with parameters determined within the code itself.

                我不是要調(diào)用外部函數(shù)或方法,而是要調(diào)用 WinXP 環(huán)境中的實際 .exe 或批處理/腳本文件.

                I'm not looking to call an outside function or method, but an actual .exe or batch/script file within the WinXP environment.

                C 或 C++ 將是首選語言,但如果使用任何其他語言(ASM、C#、Python 等)更容易做到這一點,請告訴我.

                C or C++ would be the preferred language but if this is more easily done in any other language let me know (ASM, C#, Python, etc).

                推薦答案

                當(dāng)您調(diào)用 CreateProcess()、System() 等時,請確保將文件名字符串(包括命令程序文件名)用雙引號括起來,以防萬一文件名和/或完全限定的路徑有空格,否則文件名路徑的部分將被命令解釋器解析為單獨的參數(shù).

                When you call CreateProcess(), System(), etc., make sure you double quote your file name strings (including the command program filename) in case your file name(s) and/or the fully qualified path have spaces otherwise the parts of the file name path will be parsed by the command interpreter as separate arguments.

                system(""d:some path\program.exe" "d:\other path\file name.ext"");
                

                對于 Windows,建議使用 CreateProcess().它的設(shè)置更混亂,但您可以更好地控制進(jìn)程的啟動方式(如 Greg Hewgill 所述).為了快速和骯臟,您還可以使用 WinExec().(system() 可移植到 UNIX).

                For Windows it is recommended to use CreateProcess(). It has messier setup but you have more control on how the processes is launched (as described by Greg Hewgill). For quick and dirty you can also use WinExec(). (system() is portable to UNIX).

                啟動批處理文件時,您可能需要使用 cmd.exe(或 command.com)啟動.

                When launching batch files you may need to launch with cmd.exe (or command.com).

                WinExec("cmd "d:some path\program.bat" "d:\other path\file name.ext"",SW_SHOW_MINIMIZED);
                

                (或者 SW_SHOW_NORMAL 如果你想顯示命令窗口).

                (or SW_SHOW_NORMAL if you want the command window displayed ).

                Windows 應(yīng)該在系統(tǒng) PATH 中找到 command.com 或 cmd.exe,因此不需要完全限定,但如果您想確定您可以使用 CSIDL_SYSTEM(不要簡單地使用 C:Windowssystem32cmd.exe).

                Windows should find command.com or cmd.exe in the system PATH so in shouldn't need to be fully qualified, but if you want to be certain you can compose the fully qualified filename using CSIDL_SYSTEM (don't simply use C:Windowssystem32cmd.exe).

                這篇關(guān)于如何調(diào)用帶有參數(shù)的外部程序?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                In what ways do C++ exceptions slow down code when there are no exceptions thown?(當(dāng)沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                When and how should I use exception handling?(我應(yīng)該何時以及如何使用異常處理?)
                Scope of exception object in C++(C++中異常對象的范圍)
                Catching exceptions from a constructor#39;s initializer list(從構(gòu)造函數(shù)的初始化列表中捕獲異常)
                Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區(qū)別)

                  <bdo id='7M1mZ'></bdo><ul id='7M1mZ'></ul>
                • <i id='7M1mZ'><tr id='7M1mZ'><dt id='7M1mZ'><q id='7M1mZ'><span id='7M1mZ'><b id='7M1mZ'><form id='7M1mZ'><ins id='7M1mZ'></ins><ul id='7M1mZ'></ul><sub id='7M1mZ'></sub></form><legend id='7M1mZ'></legend><bdo id='7M1mZ'><pre id='7M1mZ'><center id='7M1mZ'></center></pre></bdo></b><th id='7M1mZ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7M1mZ'><tfoot id='7M1mZ'></tfoot><dl id='7M1mZ'><fieldset id='7M1mZ'></fieldset></dl></div>

                  <small id='7M1mZ'></small><noframes id='7M1mZ'>

                      <tbody id='7M1mZ'></tbody>
                      <tfoot id='7M1mZ'></tfoot>

                      1. <legend id='7M1mZ'><style id='7M1mZ'><dir id='7M1mZ'><q id='7M1mZ'></q></dir></style></legend>
                          主站蜘蛛池模板: 国产精品久久久久影院色老大 | 久久久久国产精品www | 蜜桃视频在线观看www社区 | 欧美黄在线观看 | 一区二区三区四区电影视频在线观看 | 精品美女在线观看 | 人人做人人澡人人爽欧美 | 国产视频不卡一区 | 国产精品视频一区二区三区 | 欧美极品一区二区 | 99re视频在线免费观看 | 国产成人福利在线 | 久久久免费毛片 | 一级欧美 | 日日夜夜狠狠操 | 久久高清 | 欧美综合一区二区 | 精品二区| 久久lu | 国产精品久久国产精品 | 在线欧美亚洲 | 国产婷婷色综合av蜜臀av | 精品视频一区二区三区 | 亚洲国产一区二区三区 | 成人精品一区亚洲午夜久久久 | 色爱综合网| 天天综合干 | 精品9999| www.婷婷| 亚洲国产一区视频 | 91深夜福利视频 | av片在线观看网站 | 亚洲天天干 | 高清一区二区视频 | 狠狠骚 | 一级毛片大全免费播放 | 久久久久久久香蕉 | 日本在线一二 | 五月天婷婷狠狠 | 亚洲第一福利视频 | 色婷婷综合久久久中字幕精品久久 |