Click here to Skip to main content
Click here to Skip to main content
Go to top

How to create a virtual directory with C#

, 5 Jul 2001
Rate this:
Please Sign up or sign in to vote.
A simple example of using the DirectoryServices namespace in .NET
<!-- Download Links --> <!-- Article image -->

Sample Image - virtualdir.jpg

<!-- Main HTML starts here -->

Introduction

This "how to" is only one more sample of how to use the DirectoryServices namespace in the Microsoft.Net framework. This sample uses IIS as its Active Directory provider. The access to Active Directory in .Net is so easy. You use System.DirectoryServices.dll for simple access.

I implemented a simple class called IISManager, it has two methods: Connect and CreateVirtualDirectory.

// To use it...
            
// Default constructor initialize the servername to localhost
// you could use IISManager(servername) 
IISManager isMang = new IISManager();
isMang.Connect();
try
{
	isMang.CreateVirtualDirectory(txtName.Text,txtPath.Text);
}
catch (Exception ex)
{
	MessageBox.Show(ex.Message);
}

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Gaston
Web Developer
Uruguay Uruguay
No Biography provided

Comments and Discussions

 
QuestionDoes not work properly with Windows 7 64 bit and VS 2010 PinmemberJVH35-Oct-11 5:33 
AnswerRe: Does not work properly with Windows 7 64 bit and VS 2010 PinmemberMarcus Kramer24-Jan-12 4:35 
GeneralUnable to create virtual directory in a remote machine using directory entry class Pinmembersanthoshkumars@zylog.co.in13-Oct-09 3:02 
GeneralSharing folder via internet... Pinmemberb0074-Nov-08 10:49 
Questionhow to access the files of public folder of a remote machine in vb.net window application Pinmemberkk_upadhyay27-Feb-08 20:16 
GeneralExample systray app to create/edit virtual directories PinmemberMonkeyBumps27-Nov-07 17:08 
GeneralModified CreateVirtualDirectory method to allow running ASP.Net App's PinmemberVahid_Nasiri24-Jun-07 20:48 
QuestionHow to Turn Off Anonymous Authentication PinmemberTom So12-Jan-07 8:41 
GeneralUnknown name exception while creating Virtual Directory on remote machine Pinmemberkdp_1236-Dec-06 17:45 
GeneralRe: Unknown name exception while creating Virtual Directory on remote machine Pinmemberpavankumarchakilam1-Apr-10 21:03 
GeneralNot works with Add method PinmemberYuri Kiselev22-Nov-06 0:00 
GeneralRe: Not works with Add method PinmemberWIROL18-Oct-07 0:04 
GeneralAnother way of creation and deletion of VD in 2.0 Pinmemberdigitally_urs17-Nov-06 2:35 
GeneralIIS Virtual Directory PinmemberSen K Mathew17-Jul-05 20:12 
GeneralRe: IIS Virtual Directory Pinmemberavidgator18-Aug-05 15:01 
QuestionHow do I create VD pointing to another site PinmemberKushal Prasad29-Mar-05 20:38 
GeneralI found this version Pinmemberalan_every18-Dec-03 3:10 
GeneralI am unable to set a path in the real path Pinmembervimalkd19-Oct-03 5:11 
GeneralRe: I am unable to set a path in the real path Pinmembercuongnle6-Aug-07 22:28 
GeneralRe: I am unable to set a path in the real path PinmemberWIROL18-Oct-07 0:09 
GeneralVirtual Directory not showing in Internet Services Manager PinmemberSeattleCoder23-Jun-03 11:04 
GeneralRe: Virtual Directory not showing in Internet Services Manager PinsussAnonymous28-Jun-05 0:45 
QuestionHow to Create a VD in non-Default web Site PinsussJShi21-Jun-03 8:51 
AnswerRe: How to Create a VD in non-Default web Site PinmemberPhoneTech10-Jul-03 6:22 
GeneralApplicationProtection Property. PinmemberKent Moyle28-May-03 17:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 6 Jul 2001
Article Copyright 2001 by Gaston
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid