Cannot access the file because it is being used by another process

后端 未结 4 502
-上瘾入骨i
-上瘾入骨i 2020-12-17 00:47

My web method creates a pdf file in my %temp% folder and that works. I then want to add some custom fields (meta) to that file using the code below.

The class

4条回答
  •  再見小時候
    2020-12-17 01:30

    I suggest you to use the FileShare enumerator when you open the file, so Try to open a file with None sharing

       File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.None);
    

提交回复
热议问题