如何使用c#打开?
它显示System.ComponentModel.Win32Exception:‘系统找不到指定的文件’
我也尝试过Process.Start("C:\\Program Files(x86)\\Google\\Chrome\\Application\\chrome.exe");,但它显示了同样的例外
using System;
using System.Diagnostics;
namespace tempTest
{
class Program
{
static void Main(string[] args)
{
Process.Start("chrome.exe");
}
}
}发布于 2019-11-19 08:27:32
可以从注册表读取铬应用程序路径。您可以尝试使用以下代码:
var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe", false);
if(key != null)
{
var path = Path.Combine(key.GetValue("Path").ToString(), "chrome.exe");
if(File.Exists(path))
{
Process.Start(path);
}
}https://stackoverflow.com/questions/58929156
复制相似问题