读书人

C#打开外部文件如txt资料

发布时间: 2012-12-18 12:43:41 作者: rapoo

C#打开外部文件,如txt文件

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);

?

读书人网 >C#

热点推荐