首页 > 解决方案 > 使用 explorer.exe 打开特定文件夹

问题描述

我正在尝试使用 explorer.exe 打开一个特定的文件夹,如果该文件夹不存在,预计会出现错误,但它只是打开一个默认文件夹。

这是我的代码:

ProcessStartInfo startArgs = new ProcessStartInfo() { FileName = "explorer.exe", Arguments = Path.Combine(deskPath, "Room 1", "9am") };
try
{
    Process.Start(startArgs);
}
catch(exception ex) label1.Text = ex.Message; }

标签: c#

解决方案


推荐阅读