打开文件夹
在运行中,输入 Explorer /select,C:\Windows\System32\cmd.exe 达到打开文件夹并选择文件夹内的一个文件的目的
打开文件所在位置并且选中这个文件
|
public void ExplorerFile(string path)
{
System.Diagnostics.Process.Start("explorer.exe", @"/select," + path);
}
|
打开文件夹
|
public void ExplorerDirectory(string path)
{
System.Diagnostics.Process.Start("explorer.exe",path);
} |
使用
|
private void button4_Click(object sender, EventArgs e)
{
ExplorerFile(@"C:\Windows\System32\cmd.exe");
ExplorerDirectory(@"C:\windows");
} |

浙公网安备 33010602011771号