private string RunCmd(string command)
{
//实例一个Process类,启动一个独立进程
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.Arguments = "/c "+"\""+System.Windows.Forms.Application.StartupPath+"\\r ar.exe" +"\""+ command; //设定程式执行参数
p.StartInfo.UseShellExecute = false; //关闭Shell的使用
p.StartInfo.RedirectStandardInput = true; //重定向标准输入
p.StartInfo.RedirectStandardOutput = true; //重定向标准输出
p.StartInfo.RedirectStandardError = true; //重定向错误输出
p.StartInfo.CreateNoWindow = true; //设置不显示窗口
p.Start(); //启动
string retstr=p.StandardOutput.ReadToEnd();
p.WaitForExit();
p.Close();
return retstr; //从输出流取得命令执行结果
}
/// <summary>
/// 获得RAR信息
/// </summary>
/// <param name="rar_path
{
//实例一个Process类,启动一个独立进程
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.Arguments = "/c "+"\""+System.Windows.Forms.Application.StartupPath+"\\r ar.exe" +"\""+ command; //设定程式执行参数
p.StartInfo.UseShellExecute = false; //关闭Shell的使用
p.StartInfo.RedirectStandardInput = true; //重定向标准输入
p.StartInfo.RedirectStandardOutput = true; //重定向标准输出
p.StartInfo.RedirectStandardError = true; //重定向错误输出
p.StartInfo.CreateNoWindow = true; //设置不显示窗口
p.Start(); //启动
string retstr=p.StandardOutput.ReadToEnd();
p.WaitForExit();
p.Close();
return retstr; //从输出流取得命令执行结果
}
/// <summary>
/// 获得RAR信息
/// </summary>
/// <param name="rar_path