Virtual directories in IIS

A

Ably+

Is possible to create virtual directories in IIS through code?
If yes, is there some example?

Thanks in advance.
 
P

Piotr Szczytowski

HI,
Yes it is possible and it is pretty easy:

using System.EnterpriseServices.Internal;

IISVirtualRoot vr = new IISVirtualRoot();

string strError;

vr.Create("IIS://localhost/W3SVC/1/Root",storageDirectory,virtualPath, out
strError);

Do not forget to add System.EnterpriseServices to your app

Best raegards,
Piotr Szczytowski
 
W

Willy Denoyette [MVP]

This is BAD advise, read the docs first .
IISVirtualRoot

This member supports the .NET Framework infrastructure and is not intended
to be used directly from your code.

You should use the System.Management namespace for this.Willy."Piotr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top