net send 系统命令的使用!(首先应该打开Message服务)
方法一:
string str;
str="Mr Zhang: " + MyText.Text;
System.Diagnostics.Process.Start("CMD.exe","/c net send 172.16.3.60 "+ str);方法二:
string str;
str="Mr Zhang: " + MyText.Text;System.Diagnostics.ProcessStartInfo
startInfo = new System.Diagnostics.ProcessStartInfo();
System.Diagnostics.Process p;
startInfo.FileName = "c://windows//system32//net.exe";
startInfo.Arguments = "send 172.16.3.60 " + str;
startInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Hidden;
p = System.Diagnostics.Process.Start(startInfo);
p.WaitForExit();文章来源于 http://www.cnblogs.com/zhangzs8896 版权归原作者所有
本文介绍了如何使用netsend系统命令发送消息到指定IP地址的方法。提供了两种实现方式,一种是直接通过Process.Start调用命令行的方式,另一种是通过创建ProcessStartInfo对象进行更详细的配置来实现。
3246

被折叠的 条评论
为什么被折叠?



