我用如下的代码取
DirectoryEntry dir = new DirectoryEntry("IIS://localhost/W3SVC/1/Root/"+_virtulDir);
_physicalDir = dir.Properties["Path"].Value.ToString();如果虚拟目录的物理路径在c:\inetpub\wwwroot\下,则此处取得的物理路径总是c:\inetpub\wwwroot,但是如果虚拟目录的物理路径不在c:\inetpub\wwwroot\下,则能正确取得完整路径哪位高人指点一下啊
DirectoryEntry dir = new DirectoryEntry("IIS://localhost/W3SVC/1/Root/"+_virtulDir);
_physicalDir = dir.Properties["Path"].Value.ToString();如果虚拟目录的物理路径在c:\inetpub\wwwroot\下,则此处取得的物理路径总是c:\inetpub\wwwroot,但是如果虚拟目录的物理路径不在c:\inetpub\wwwroot\下,则能正确取得完整路径哪位高人指点一下啊
using System.AppDomain;
......string strAddress = System.AppDomain.CurrentDomain.BaseDirectory.ToString();不知道是不是楼主想要的
我的系统是.net2.0beta2,XP sp2。
可能是系统环境不一样导致了那些的问题,要不然就是.net1.1有bug