zoukankan      html  css  js  c++  java
  • C# 调用CMD,执行DOS命令

    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();
       string strOutput=null;
    //   p.StandardInput.WriteLine("cd D:\\flv\\mplayer");
    //   p.StandardInput.WriteLine("cd d:");
       p.StandardInput.WriteLine(string.Format("D:\\flv\\mplayer\\mencoder \"c:\\vs.wmv\" -o \"c:\\output.flv\" -of lavf  -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate={0}:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:dia=4:cmp=6:vb_strategy=1 -vf scale=512:-3 -ofps 12 -srate 22050",200));
      
       p.StandardInput.WriteLine("exit");
       strOutput = p.StandardOutput.ReadToEnd();
       Console.WriteLine(strOutput);
       p.WaitForExit();
       p.Close();
  • 相关阅读:
    圣战 [奇环, 树上差分]
    花火之声不闻于耳 [线段树]
    SP2878 KNIGHTS
    P5300 [GXOI/GZOI2019]与或和 [单调栈]
    Speike [线段树, 动态规划]
    Jerry [动态规划]
    JSON对象
    正则书写
    flex布局实践
    数组对象的深拷贝与浅拷贝
  • 原文地址:https://www.cnblogs.com/zhangjun1130/p/1688668.html
Copyright © 2011-2022 走看看