首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

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

2012-12-18 
C#打开外部文件,如txt文件string filePath @d:\test.txtif (filePath.Equals()) {MessageBox.Show(

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

?

热点排行