文件流操作,报“because it is being used by another process. ”错误解决

文件流操作,报“because it is being used by another process. ”错误解决

FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);

将这句替换成:

using( FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read))
 { }

你可能感兴趣的:(文件流操作,报“because it is being used by another process. ”错误解决)