Winform中直接打开指定文件

 string v_OpenFilePath = @"c:\新建文本文件.txt";

            if (v_OpenFilePath.Equals(""))
            {
                MessageBox.Show("路径不能为空!","操作提示");
                return;
            }

            //先判断文件是否存在,不存在则提示
            if (!System.IO.File.Exists(v_OpenFilePath))
            {
                MessageBox.Show("指定文件不存在!","操作提示");
                return;
            }
            //存在则打开
            System.Diagnostics.Process.Start("explorer.exe",v_OpenFilePath);

posted @ 2009-02-19 16:53  phcis  阅读(2628)  评论(2编辑  收藏  举报