C# The process cannot access the file ''' because it is being used by another process

前端 未结 10 1422
执念已碎
执念已碎 2020-12-18 08:34

The snippet of code was just supposed to write a string into a text file called \"all_results.txt\". I had errors implementing in File.WriteAllText. After searching the net

10条回答
  •  情书的邮戳
    2020-12-18 09:13

    Try using lock around your file operations. http://msdn.microsoft.com/en-us/library/c5kehkcz.aspx

提交回复
热议问题