`

NET中如何执行命令行命令

    博客分类:
  • C#
阅读更多
可以通过Process类和ProcessStartInfo类实现,也可以使用管道等操作,如:> |等。下面就是一个例子

System.Diagnostics.Process.Start("CMD.exe","/c net send 192.168.3.6 你今天过的好吗?");
System.Diagnostics.Process.Start("cmd.exe", "/c foo.exe -arg " + "| bar.exe");
注意:net send 需要启用 Messenger 服务
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics