简体   繁体   中英

Unable to create folder on network drive

I'm trying to create a folder on network drive through windows application in C#.

The problem which I'm facing is that while the .exe is getting installed it opens up a window and asks for the network drive path. When I provide the path and click on "Ok" it doesn't create a folder. I checked it in the network drive that folder doesn't exist.

When the exe gets installed and I launch the application and this time if I provide a N/w drive path. It creates the folder with no problem.

Same window page gets opened both the time and the same code gets executed but at the time of installation it doesn't create folder on network drive.

I used System.IO.Directory.CreateDirectory(sFilePath) 'Create directory if doesn't exist.

I don't think it's related to permission because I'm able to create network folder through the application after the .exe gets installed successfully.

Any help would be highly appreciated.

Thanks

There is not much to go after here.

Are you accessing a mapped drive?

If you program is running under UAC with elevated privileges, then you will not have access to you mapped drives, in this case provide the full unc path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM