打开文件夹



在运行中,输入  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 senderEventArgs e)
        {
            ExplorerFile(@"C:\Windows\System32\cmd.exe");
            ExplorerDirectory(@"C:\windows");
        }
 
posted @ 2013-11-21 23:59  XE2011  阅读(311)  评论(0编辑  收藏  举报