日期:2014-05-17 浏览次数:21148 次
string filePath = @"d:\test.txt";
if (filePath.Equals("")) {
MessageBox.Show("路径不能为空!","操作提示");
return;
}
//先判断文件是否存在,不存在则提示
if (!System.IO.File.Exists(filePath)) {
MessageBox.Show("指定文件不存在!","操作提示");
return;
}
//存在则打开
System.Diagnostics.Process.Start("explorer.exe",filePath);
?