Unhandled exception. System.IO.IOException: The process cannot access the file 'H:\testDirectory\d1\d2\test.text' because it is being used by another process.
橘子皮...的博客Dim A = New StreamWriter("号.txt") ‘默认允许脏读 'Dim c = New StreamReader("号.txt") ’默认不允许脏读 Dim CC = New StreamReader(New FileStream("号.txt", FileMode.Open, FileAccess.Read, FileShare.Read...
guyueyuzuyun的博客试了很多种方法,共享锁也试了,最终还是这个方法解决的 private static object o = new object(); ThreadPool.QueueUserWorkItem(new WaitCallback(obj =>... using (var sw = new StreamWriter(logPa