c# - 隐藏窗口C#winform时如何打印出CMD命令的输出?
问题描述
我想在隐藏窗口时将使用 C# 将命令输入 CMD 的输出打印到文本框。到目前为止,这是我的代码:
double bytes = double.Parse(textBox2.Text);
string domain = url.Replace("https://", "");
string commands = "ping" + domain + "-t -l " + bytes;
var proc = new Process();
proc.StartInfo.FileName = "CMD.exe";
proc.StartInfo.Arguments = commands;
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
proc.Start();
解决方案
推荐阅读
- python - 即使脚本正确编译,python 脚本网站拦截器也无法正常工作
- angular-routerlink - 在星云中如何将 routerLink 应用于用户下拉列表
- javascript - 为什么第一个代码有效而第二个无效?
- ruby-on-rails - 使用 Jasmine 进行 Rails 5 测试 - Jasmine 测试需要“导出类”,但会破坏我的页面
- vb.net - vb.net 将文本文件按部分拆分为不同的文件
- pagination - Janusgraph 中的分页 - 如何在 Java 中实现 traversal.next(pagesize)
- javascript - 在滑块输入到 javascript 变量时画布请求动画超出帧
- c++ - 对模板类成员的未定义引用
- php - Woocommerce 中的“警告:WC_Custom_Product 缺少参数 2”
- apache - AH01630:客户端被服务器配置拒绝,从一个虚拟主机重定向到另一个