473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Virtual directories in IIS

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

Thanks in advance.
Nov 17 '05 #1
4 1589
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

"Ably+" <ab******@yahoo.com> schrieb im Newsbeitrag
news:Ol**************@tk2msftngp13.phx.gbl...
Is possible to create virtual directories in IIS through code?
If yes, is there some example?

Thanks in advance.

Nov 17 '05 #2
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
Szczytowski" <ps**********@atp.ruhr-uni-bochum.de> wrote in message
news:d6**********@inews.gazeta.pl...
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

"Ably+" <ab******@yahoo.com> schrieb im Newsbeitrag
news:Ol**************@tk2msftngp13.phx.gbl...
Is possible to create virtual directories in IIS through code?
If yes, is there some example?

Thanks in advance.


Nov 17 '05 #3

"Ably+" <ab******@yahoo.com> wrote in message
news:Ol**************@tk2msftngp13.phx.gbl...
Is possible to create virtual directories in IIS through code?
If yes, is there some example?

Thanks in advance.


Check MSDN online :

http://msdn.microsoft.com/library/de...7fd414a634.asp

Willy.
Nov 17 '05 #4

"Ably+" <ab******@yahoo.com> wrote in message
news:Ol**************@tk2msftngp13.phx.gbl...
Is possible to create virtual directories in IIS through code?
If yes, is there some example?

Thanks in advance.


When administrating IIS6, you better use System.Management namespace classes
and WMI

http://msdn.microsoft.com/library/de...5c99b2e0fc.asp

Willy.
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark Hoagland | last post by:
I've got a scenario with a web application where I must access the virtual directory being accessed from within the Application_OnStart event handler. Specifically, I have a series of IIS virtual...
5
by: George Hester | last post by:
If I have 1 Virtual Dirctory with 2 different subfolders are these 2 different folders different virtual folders? Or if I have 2 different Virtual Directories each containing a subfolder are these...
3
by: pleaseHelp | last post by:
To better manage our secure site we just separated the registration and checkout sections of our web into separate virtual directories. These new virtual directories are on the same server as the...
2
by: Jeffry van de Vuurst | last post by:
Hi, (sorry for the crosspost, I wasn't sure which was the best place to put this). I was just thinking about something and wondered if any of you has some ideas about this. I'm using the...
4
by: Michelle | last post by:
I have a website with 6 virtual directories under it who dont "see" the bin/ directory in the root. If I create a /bin directory in each virtual directory and then copy my dll's in there, it...
1
by: Mark | last post by:
In our root web site, we have roughly 100 folders. 10 of these are virtual directories. The other 90 folders are a mix - some contain static HTML content. Others contain subfolders and...
4
by: Chuck P | last post by:
Using vs05 and making an asp.net 2.0 website. We use VSS and have everything organized like this SolutionName Documents Code WebProjectName1 WebServiceProjectName1
2
by: Angelo Cook | last post by:
how do you prevent the publishing of virtual directories in VS 2005. I have been using VS2003 and developing websites for years. I have been using virtual directories for images, icons, styles...
4
by: =?Utf-8?B?SmVmZiBCZWVt?= | last post by:
Best way I can think to describe this is through an example. I have a virtual directory, let's call it "MyVirtualDirectory" that maps to \\MyServer\Shared. I have a path that is...
4
by: Paul F | last post by:
Im confused about the difference(s) between virtual directories and physical directories in IIS. Any ideas? *** Sent via Developersdex http://www.developersdex.com ***
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.