110,539
社区成员
发帖
与我相关
我的任务
分享
Process p=new Process(); //创建进程对象
p.StartInfo.FileName="net.exe"; //设定需要执行的命令程序
p.StartInfo.Arguments=" use "+NetUseArg; 设定参数,要输入到命令程序的字符
p.StartInfo.UseShellExecute=false; //不使用系统外壳程序启动
p.StartInfo.RedirectStandardOutput=true; 重定向输出,而不是默认的显示在dos控制台上
p.StartInfo.RedirectStandardInput=true; //重定向输入
p.StartInfo.RedirectStandardError = true; //重定向錯誤輸出
p.StartInfo.CreateNoWindow=true; //不创建窗口