benjieb
benjieb

Reputation: 85

accessing multiple virtual directories using a single web app

Is it possible to look into multiple virtual directories, 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!

Upvotes: 0

Views: 726

Answers (1)

volpav
volpav

Reputation: 5128

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.

Upvotes: 1

Related Questions