c# - 如何确定 .NET 中 explorer.exe 的路径?

标签 c# .net visual-studio

我需要在 C# 项目中确定原始 explorer.exe 在 32 位和 64 位 Windows 上的路径。实现该目标的最可靠方法是什么?

最佳答案

我会使用环境变量“windir”,因为 explorer.exe 位于其中

string windir = Environment.GetEnvironmentVariable("windir");
string explorerPath = windir + @"\explorer.exe";

关于c# - 如何确定 .NET 中 explorer.exe 的路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3734521/

相关文章:

c# - 无法解析/使用 System.ServiceModel.Security.WSTrustServiceContract 作为服务名称

c# - 在异步环境中共享资源池的有效方法是什么?

c# - 如何通过除ID以外的其他属性查询聚合根?

c++ - Visual Studio 调试 - 局部变量的顺序?

visual-studio - Visual Studio 最近的 "hungry"或 "greedy"退格行为更新?

c++ - 如何摆脱 Visual Studio 中的 "unsafe"警告/错误(strcpy、sprintf、strdup)

c# - 防止用户通过系统热键退出 Windows 应用程序

c# - 在 finally block 中调用 .ConfigureAwait(false) 是否安全?

c# - 主题页面错误中的 ELMAH

.net - 将 CancellationToken 作为参数传递给 Task.Run 有什么好处?