c#打开资源管理器

216 阅读1分钟

winform点击按钮打开资源管理器,并定位到指定文件。

private void toolStripStatusLabel1_Click(object sender, EventArgs e)
        {
            System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("Explorer.exe");
            psi.Arguments = "/e,/select," + path[i];
            System.Diagnostics.Process.Start(psi);
        }

其中path[i]为文件路径。