How can I access a mapped network drive with System.IO.DirectoryInfo?

后端 未结 7 1695
无人及你
无人及你 2020-12-28 13:03

I need to create a directory on a mapped network drive. I am using a code:

DirectoryInfo targetDirectory = new DirectoryInfo(path);
if (targetDirectory != nu         


        
7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-28 13:42

    Are you running on Vista/Server 2k8? Both of those isolate services into Session 0 and the first interactive session is Session 1. There's more info here, on session isolation. Thus, even if it's the same user being used for both the service and the interactive logon, it'll be different sessions.

提交回复
热议问题