当文件已经被别的应用打开时,就不能再用以下语句打开
StreamReader reader;
reader = File.OpenText(fname);
请请问如何可以同时打开呢?
------解决思路----------------------
using (FileStream fs = new FileStream(fname, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (StreamReader reader = new StreamReader(fs))
{
string s = reader.ReadToEnd();
}