Swa*_*aff 13
我强烈建议使用Microsoft.Web.Administration dll为IIS提供出色的管理功能.
ServerManager serverManager = new ServerManager();
// get the site (e.g. default)
Site site = serverManager.Sites.FirstOrDefault(s => s.Name == "Default Web Site");
// get the application that you are interested in
Application myApp = site.Applications["/Dev1"];
// get the physical path of the virtual directory
Console.WriteLine(myApp.VirtualDirectories[0].PhysicalPath);
Run Code Online (Sandbox Code Playgroud)
得到:
F:\开发\分行\ DEV1
| 归档时间: |
|
| 查看次数: |
17760 次 |
| 最近记录: |