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();
  • 相关阅读:
    名字匹配(水题)
    奇怪的键盘
    杰杰的键盘
    Windows Message Queue(优先队列)
    筛法求素数
    会场安排问题(贪心)
    Sail
    Elevator
    Lowest Bit
    File Searching
  • 原文地址:https://www.cnblogs.com/zhwl/p/2030801.html
Copyright © 2011-2022 走看看