FileStream with locked file

后端 未结 4 2031
悲&欢浪女
悲&欢浪女 2020-12-11 14:50

I am wondering if it\'s possible to get a readonly FileStream to a locked file? I now get an exception when I try to read the locked file.

using (FileStream          


        
4条回答
  •  有刺的猬
    2020-12-11 15:39

    You can simply unlock file and read file after it. Just use Handle.exe from Sysinternals , or Unlocker with command line options. They both can unlock file , and you can execute them from your program easily, without leaving your program. (But don't use them for Windows SAM file, it doesn't work with SAM ;) ) Good luck !

提交回复
热议问题