FileSystemWatcher Fails to access network drive

后端 未结 7 2264
春和景丽
春和景丽 2020-11-27 23:12

I am trying to run a file watcher over some server path using windows service. I am using my windows login credential to run the service, and am able to access this \"someSe

7条回答
  •  半阙折子戏
    2020-11-27 23:42

    I have projects using the FileSystemWatcher object monitoring UNC paths without any issues.

    My guess from looking at your code example may be that you are pointing the watcher at the root share of the server (//servername/) which may not be a valid file system share? I know it returns things like printers, scheduled tasks, etc. in windows explorer.

    Try pointing the watcher to a share beneath the root - something like //servername/c$/ would be a good test example if you have remote administrative rights on the server.

提交回复
热议问题