开发者

accessing multiple virtual directories using a single web app

开发者 https://www.devze.com 2023-02-04 04:13 出处:网络
Is it possible to look into multiple virtual director开发者_StackOverflow中文版ies, using a single web application?

Is it possible to look into multiple virtual director开发者_StackOverflow中文版ies, using a single web application?

I'm trying to develop a web app; which can create a site, save this site to a virtual directory in the same server, and make changes (i.e. add/edit webpages).

The web app will handle multiple domain names (IIS will handle the bindings going into the single web app), which are routed by the web app to their respective virtual directories.

Can anyone point me to the right direction?

Thanks!


First of all, you need a certain permissions in order to manipulate the IIS metabase. The default ASP.NET user account doesn't have such permissions so you might want to use an impersonation. You can read more here (what is impersonation) and here (how to impersonate programmatically).

To configure the IIS programmatically use the classes from the System.DirectoryServices namespace. You can read more about how to do this here (tagged as for IIS6). You can also use the Microsoft.Web.Administration namespace (which seems more specific to IIS7) but in this case you need to download and install the corresponding SDK.

Hope I clarified things for you a bit.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号