C#读写文件流方法
来源:互联网 发布:淘宝清理缓存后会怎样 编辑:程序博客网 时间:2024/06/07 06:05
static void Main(string[] args) { //C#文件流写文件,默认追加FileMode.Append string msg = "okffffffffffffffff"; byte[] myByte = System.Text.Encoding.UTF8.GetBytes(msg); using (FileStream fsWrite = new FileStream(@"D:\1.txt", FileMode.Append)) { fsWrite.Write(myByte, 0, myByte.Length); }; //c#文件流读文件 using (FileStream fsRead = new FileStream(@"D:\1.txt", FileMode.Open)) { int fsLen = (int)fsRead.Length; byte[] heByte = new byte[fsLen]; int r = fsRead.Read(heByte, 0, heByte.Length); string myStr = System.Text.Encoding.UTF8.GetString(heByte); Console.WriteLine(myStr); Console.ReadKey(); } }
0 0
- C#读写文件流方法
- C#文件读写常用方法
- c#读写INI文件方法
- c#文件流读写
- C#播放声音的两个方法 + 流读写文件
- c#读写文件的几个小方法
- C#读写XML文件方法整理
- C#读写INI文件的方法
- C#读写txt文件的方法
- C#读写文件的方法汇总
- C#读写xml文件的常用方法
- C#读写xml文件的常用方法
- C# 读写文件的方法汇总
- C#读写xml文件的常用方法
- C#读写xml文件的常用方法
- C#文件的读写 -流
- C# 文件流读写记事本
- C# FileStream流文件读写
- Git 教程
- 行人检测论文大全
- 致雅嵌入式工作室——WEB的一些概念汇总
- servlet的请求方式
- Myeclipse下怎样运行servlet程序
- C#读写文件流方法
- VS/VC++出现fatal error rc1107 错误的处理办法
- android端快速集成EaseUI,跳过那些坑
- 闹钟AlarmManager PendingIntent获取方法中的注意事项
- Myeclipse下部署项目以及JSP的连接
- Matlab问答day3
- 第一行代码学习笔记---安卓学习路线图
- 大数相乘、大数相加、大数相减Java版本
- Mysql各种存储引擎的特性以及如何选择存储引擎