第十一章节文件操作和输入输出流.pptVIP

  • 2
  • 0
  • 约1.18千字
  • 约 17页
  • 2017-04-23 发布于四川
  • 举报
第十一章节文件操作和输入输出流

第十一章;目标;体验;文件和流;IO 命名空间和它类;;流I/O操作类;其他I/O流类;目录管理; string path = @c:\MyDir; string target = @c:\TestDir; try { if (Directory.Exists(target)) { Directory.Delete(target, true); Console.WriteLine(Path:{0} is deleted., path); } if (!Directory.Exists(path)) { Directory.CreateDirectory(path); Console.WriteLine(Path:{0} is created now., path); } else { Console.WriteLine(Path:{0} is exist.,path);} } Directory.Move(path, target); Directory.CreateDirectory(target + @\subdir); File.CreateText(target + @\myfile.txt); Console.WriteLine(The number of files in {0} is {1}, target, Directory.GetFiles(target).Length); } catch (Exception e) { Console.WriteLine(The process failed: {0}, e.ToString()); } finally { } ;递归算法;递归示例;文件管理;文本模式文件数据读写 ;文件流获得;二进制模式文件数据读写 ;总结

文档评论(0)

1亿VIP精品文档

相关文档