process.start()为什么创建不了进程(附代码)
public static bool DeZip(string RarFilePath, string OuputFileDir)
{
bool result = false;
String Rar;
RegistryKey Reg;
Object Obj;
String Info;
ProcessStartInfo StartInfo;
Process Process;
try
{
System.Threading.Thread.Sleep(30);
Reg = Registry.ClassesRoot.OpenSubKey(@"Applications\WinRar.exe\Shell\Open\Command");
Obj = Reg.GetValue("");
Rar = Obj.ToString();
Reg.Close();
Rar = Rar.Substring(1, Rar.Length - 7);
Info = " X " + RarFilePath + " " + OuputFileDir;
StartInfo = new ProcessStartInfo();
StartInfo.FileName = Rar;
StartInfo.Arguments = Info;
StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
Process = new Process();
Process.StartInfo = StartInfo;
System.Diagnostics.Process.Start(StartInfo);
result = true;
System.Threading.Thread.Sleep(500);
}
catch (Exception) { }
return result;
}
程序运行到System.Diagnostics.Process.Start(StartInfo)这一句就不动了。请大家帮忙解决下