Process p=new Process();
p.StartInfo.FileName="net.exe";
p.StartInfo.Arguments=" use "+NetUseArg;
p.StartInfo.UseShellExecute=false;
p.StartInfo.RedirectStandardOutput=true;
p.StartInfo.RedirectStandardInput=true;
p.StartInfo.RedirectStandardError   =   true;
p.StartInfo.CreateNoWindow=true;

解决方案 »

  1.   

    LZ是来T馆子的吧.这是一个类的实例和对该类填充信息..
      

  2.   


    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;   //不创建窗口