我在 C# 中有一个 winforms 应用程序,我必须在其中打开某个文件夹。我用
System.Diagnostics.Process.Start(pathToFolder);
Run Code Online (Sandbox Code Playgroud)
这导致以下异常:
System.ComponentModel.Win32Exception (0x80004005): 访问被拒绝
在 System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
在 System.Diagnostics.Process.Start()
在 System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
在 MyApp.openLogFolderToolStripMenuItem_Click(Object sender, EventArgs e)
我已经检查了以下事项:
另一件事是,如果我使用Process.Start()打开此文件夹中的文件,它会起作用。
谁能给我一个提示?
干杯
编辑
我的目标是在资源管理器中打开文件夹。的pathToFolder是一样的东西H:\Something\App.Name\Log