2011-07-21 37 views
0

我正在爲Minecraft Coder pack編寫一個實用程序。它處理運行python的批處理文件。是否有可能從cmd中讀取和寫入文本框併爲cmd運行vb.net命令?來自CMD的VB.net VB.net

回答

4

是的。看到我的答案在這裏:Opening a plink window from VB.NET application without showing the black ugly plink window

基本上,你想隱藏窗口,並重定向標準輸入/輸出。

Dim p as New Process 
With p.StartInfo 
    .WindowStyle=ProcessWindowStyle.Hidden 
    .RedirectStandardOutput=true 
    .RedirectStandardInput=true 
End With 

您可以讀取並使用p.StandardInputp.StandardOutput寫。

您還可以在ProcessStartInfo class中找到更多選項。