1 頁 (共 1 頁)

如何執行外部程式

發表於 : 2008年 11月 27日, 16:59
tim
可以使用 ShellExecute 或是 WinExec
其中 ShellExecute 要 use ShellAPI,
WinExec 則是 Windows.
其語法如下:
ShellExecute 要傳入 (0,'OPEN', 指令, 參數, nil, 方式)
WinExec 則只要傳入 ( 指令(含參數), 方式)
即可

代碼: 選擇全部

      ShellExecute(0, PChar('OPEN'), 'ping.exe', '127.0.0.1 -t', nil, SW_SHOWNA); 
      WinExec( PChar('ping.exe 127.0.0.1 -t'),  SW_SHOWNA);