Virtual directories in IIS

  • Thread starter Thread starter Ably+
  • Start date Start date
A

Ably+

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

Thanks in advance.
 
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
 
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
 
Back
Top