zoukankan      html  css  js  c++  java
  • c#调用Dos命令(超捷)

      string[] cmd = new string[] { @"cd C:\Program Files\华光科技\超捷网络4.2", "YJClient.exe $StartFromXinWen$ admin 00" };
                    Process p = new Process();
                    p.StartInfo.FileName = "cmd.exe";
                    p.StartInfo.UseShellExecute = false;
                    p.StartInfo.RedirectStandardInput = true;
                    p.StartInfo.RedirectStandardOutput = true;
                    p.StartInfo.RedirectStandardError = true;
                    p.StartInfo.CreateNoWindow = true;
                    p.Start();
                    p.StandardInput.AutoFlush = true;
                    for (int i = 0; i < cmd.Length; i++)
                    {
                        p.StandardInput.WriteLine(cmd[i].ToString());
                    }
                    p.StandardInput.WriteLine("exit");
                    string strRst = p.StandardOutput.ReadToEnd();
                    p.WaitForExit();
                    p.Close();
  • 相关阅读:
    delphi XE8 for android ----一个无意闯入的世界
    不能Ping和telnet的
    syslog-ng内容讲解
    《信息安全系统设计与实现》学习笔记7
    缓冲区溢出实验
    2.3.1测试
    鲲鹏服务器测试
    cat userlist
    需求分析
    《信息安全系统设计与实现》学习笔记5
  • 原文地址:https://www.cnblogs.com/zhwl/p/2030801.html
Copyright © 2011-2022 走看看