1.bool exist = System.IO.Directory.Exists(cfg.XmlProductPath+@"\mobile\"); //判断文件夹是否存在
2.Directory.CreateDirectory(cfg.XmlProductPath + @"\mobile\"); //创建mobile文件夹
3.string[] dirs = null;
dirs = Directory.GetFiles(cfg.XmlProductPath + @"\mobile\"); //返回mobile文件夹下的文件名称
4.FileInfo fileInfo = new FileInfo(dirs[i]); //获取文件信息(含路径的包装)
string rawurl = fileInfo.Name; //获取文件名
5.string path = Application.StartupPath + "\\page.html"; //获取启动了应用程序的可执行文件的路径(不包括可执行文件的名称)
6.bool IsFileExist = File.Exists(path); //判断文件是否存在
7. File.WriteAllText(path, txtSnatch.Text, Encoding.GetEncoding(mymission.CharSet)); //创建一个新文件,向其中写入指定编码的字符串,然后关闭文件
8.System.Diagnostics.Process.Start("IEXPLORE.EXE", path0;//用IE打开指定路径的文件
System.Diagnostics.Process.Start("notepad.EXE", path);//用记事本打开指定路径的文件
网上搜集文章内容:http://www.cnblogs.com/shj0633/archive/2007/01/18/623708.html

浙公网安备 33010602011771号