我找不到 System.Diagnostics.Process 来启动新进程。我想这是故意的。但是还有别的办法吗?这可能吗?
最佳答案
You can use this reference on Windows 8 Metro application : How to Start a external Program from Metro App. All the Metro-style applications work in the highly sand boxed environment and there is no way to directly start an external application.
您可以尝试使用 Launcher class
-
// Path to the file in the app package to launch string exeFile = @"C:\Program Files (x86)\App.exe"; var file = await Windows.ApplicationModel.Package.Current.InstalledLocation .GetFileAsync(exeFile); if (file != null) { // Set the option to show the picker var options = new Windows.System.LauncherOptions(); options.DisplayApplicationPicker = true; // Launch the retrieved file bool success = await Windows.System.Launcher.LaunchFileAsync(file, options); if (success) { // File launched } else { // File launching failed } }
引用:Can I use Windows.System.Launcher.LauncherDefaultProgram(Uri) to invoke another metro style app?
关于c# - 如何从 Windows 8 应用程序启动进程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13563559/