简体   繁体   中英

Directory.Exists not getting mapped directory

I have mapped a directory from another machine to my machine as Z: drive. This is further mapped inside a virtual directory on my local IIS7 . On one of my pages I am using Server.MapPath("~/dira/mapped_dir") it is giving me correct path like: Z:\\\\somedir\\\\mapped_dir . I am able to open this directory and read-write files into it. But when in the ASPX page I execute System.IO.Directory.Exists("Z:\\\\somedir\\\\mapped_dir") it returns false .

Does this have anything with permissions or there is some other issue?. The source machine (which contains the physical folder) has given read-write access to all users on the shared folder.

I know that using the SUBST command for virtual directories is a per-user setting and doesn't work with code running as a different user (eg a service). Sounds like it might be similar to your problems...

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