【发布时间】:2011-07-21 20:01:08
【问题描述】:
我正在为 Minecraft Coder 包编写实用程序。它适用于运行 python 的批处理文件。是否可以从 cmd 读取和写入文本框并将 vb.net 的命令运行到 cmd?
【问题讨论】:
我正在为 Minecraft Coder 包编写实用程序。它适用于运行 python 的批处理文件。是否可以从 cmd 读取和写入文本框并将 vb.net 的命令运行到 cmd?
【问题讨论】:
是的。在这里查看我的答案: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.StandardInput 和p.StandardOutput 进行读写。
您还可以在ProcessStartInfo class 中找到更多设置选项。
【讨论】: