摘要: foreach (var item in ReadLines("E:\\bigFile.txt")) { Console.Write(item); } /// <summary> /// 异步读取每行内容 /// </summary> /// <param name="fileName">指定文件的 阅读全文
posted @ 2019-11-26 20:44 wesson2019 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 节省内存消耗。 /// <summary> /// 字节流,包装流以实现高效的异步字节访问 /// </summary> public sealed class ByteStream : IDisposable { private readonly Stream _stream; private r 阅读全文
posted @ 2019-11-26 20:25 wesson2019 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 帮助使用者进行线程间的交互。具体的数据交流载体就是EventArgs e这个参数。 BackgroundWorker _backgroundWorker = new BackgroundWorker(); public Form1() { InitializeComponent(); InitBac 阅读全文
posted @ 2019-11-26 20:20 wesson2019 阅读(88) 评论(0) 推荐(0) 编辑