Directory.Exists not getting mapped directory

大兔子大兔子 提交于 2019-12-12 01:43:13

问题


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.


回答1:


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 (e.g. a service). Sounds like it might be similar to your problems...



来源:https://stackoverflow.com/questions/4254465/directory-exists-not-getting-mapped-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!