zoukankan      html  css  js  c++  java
  • c# 执行应用程序实例

            public static void DoRAR(string rarFile, string toRarDirecotry, string RARProgramFilePath)
            {
                string arguments = @"a -m0 -ep1 ""{0}"" ""{1}""";
                arguments = string.Format(
                    arguments,
                    rarFile,
                    toRarDirecotry
                );

                var proc = Process.Start(new ProcessStartInfo
                {
                    FileName = RARProgramFilePath,
                    Arguments = arguments,
                    UseShellExecute = false,
                    RedirectStandardOutput = true,
                    RedirectStandardError = true,
                    RedirectStandardInput = true
                }
                );
                proc.WaitForExit();

                if (proc.ExitCode != 0)
                {
                    throw new Exception("Run WinRAR RAR Command Failed!, Exit Code: " + proc.ExitCode +
                        ", Details StandardOuput: " + proc.StandardOutput.ReadToEnd() +
                        ",StandardError" + proc.StandardError.ReadToEnd() +
                        ",StandardInput" + proc.StandardInput +
                        ",Site" + proc.Site);
                }
            }

  • 相关阅读:
    网络兼职轻松赚
    微信H5支付demo
    支付宝H5支付demo
    笔记本安装SSD固态硬盘详细的优化设置
    JQuery的AJAX
    第二次面试
    存储过程的总结
    SQl数据操作和查询
    面对考试毫无畏惧的SSH
    掷骰子-IOS新手项目练习(抱歉,由于个人原因,图片没显示,要源码的项目私聊)
  • 原文地址:https://www.cnblogs.com/doosmile/p/2726468.html
Copyright © 2011-2022 走看看