我正在開發一個需要使用regini(由於遺留原因)將某些東西插入到註冊表中的應用程序。我一直在試圖以這樣的方式來執行此操作,該應用程序的用戶不知道這一點。我寫了下面的代碼:從c#應用程序使用regini而不打擾用戶?
System.Diagnostics.ProcessStartInfo pi = new ProcessStartInfo();
pi.FileName = @"c:\windows\system32\regini.exe";
pi.Arguments = name;
pi.WorkingDirectory = Utils.AppSettings.WorkingDirectory.ToString();
pi.WindowStyle = ProcessWindowStyle.Hidden;
pi.RedirectStandardError = true;
pi.RedirectStandardOutput = true;
pi.UseShellExecute = false;
Process p = new Process();
p.StartInfo = pi;
p.EnableRaisingEvents = true;
p.Start();
不幸的是,每次執行代碼時都會彈出'命令'窗口。我的印象是
pi.WindowStyle = ProcessWindowStyle.Hidden;
會阻止。我該如何防止regini打開自己的命令窗口?
謝謝,但在鏈接的討論只是論點集中上再現問題的問題。顯然他們不能。 – Bernie 2008-10-31 09:14:37