.Net Core文件多线程读取报错

错误:System.IO.IOException:“The process cannot access the file 'xxx1.txt' because it is being used by another process.”

解决:

FileStream fileStream = new FileStream(fileName, FileMode.Open,FileAccess.Read,FileShare.ReadWrite);
FileShare.ReadWrite需要加上共享去读写的权限
posted @ 2020-11-04 21:01  .Jochen  阅读(505)  评论(0编辑  收藏  举报