zoukankan      html  css  js  c++  java
  • IO边读边写

      using (FileStream fs = new FileStream(@"C:UsersDesktoplijia1.txt",FileMode.Open))
               {
                   using (FileStream fs1 = new FileStream(@"C:UsersDesktoplijia1Copy.txt", FileMode.Create))
                   {
                       byte[] arr = new byte[200];
                       int count;
                       while (fs.Position<fs.Length) //fs.Position 获得当前读取的位置
                       {
                           count = fs.Read(arr, 0, arr.Length);
                           fs1.Write(arr, 0, count);
                       }
                   }
     
               }
    好好学习,天天向上。
  • 相关阅读:
    15_门面模式
    14_责任链模式
    13_观察者模式
    12_状态模式
    11_策略模式
    10_命令模式
    09_适配器模式
    08_装饰者模式
    07_代理模式
    linux邮件服务器postfix配置实例
  • 原文地址:https://www.cnblogs.com/Zhengxue/p/6211586.html
Copyright © 2011-2022 走看看