Exception in opening a file that is already open

后端 未结 5 1048
迷失自我
迷失自我 2020-12-07 01:47

I am building an application in C# in which I have to open a CSV file to read data from it. I get an exception when I try to open the CSV file from C# when that file is alre

5条回答
  •  不思量自难忘°
    2020-12-07 02:35

    Due to concurrency issues you can not have the option to write to two instances of the same file. It should be possible to open one as read-only this would allow for there to not be a concurrency issue as reading is guaranteed to be thread safe. This article should explain how to do what I proposed

提交回复
热议问题