Click here to Skip to main content
13,042,819 members (74,407 online)
Click here to Skip to main content
Add your own
alternative version

Stats

258.1K views
5.8K downloads
58 bookmarked
Posted 5 Jul 2001

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

You may also be interested in...

Pro
Pro

Comments and Discussions

 
QuestionDoes not work properly with Windows 7 64 bit and VS 2010 Pin
JVH35-Oct-11 5:33
memberJVH35-Oct-11 5:33 
AnswerRe: Does not work properly with Windows 7 64 bit and VS 2010 Pin
Marcus Kramer24-Jan-12 4:35
memberMarcus Kramer24-Jan-12 4:35 
GeneralUnable to create virtual directory in a remote machine using directory entry class Pin
santhoshkumars@zylog.co.in13-Oct-09 3:02
membersanthoshkumars@zylog.co.in13-Oct-09 3:02 
GeneralSharing folder via internet... Pin
b0074-Nov-08 10:49
memberb0074-Nov-08 10:49 
Questionhow to access the files of public folder of a remote machine in vb.net window application Pin
kk_upadhyay27-Feb-08 20:16
memberkk_upadhyay27-Feb-08 20:16 
GeneralExample systray app to create/edit virtual directories Pin
MonkeyBumps27-Nov-07 17:08
memberMonkeyBumps27-Nov-07 17:08 
GeneralModified CreateVirtualDirectory method to allow running ASP.Net App's Pin
Vahid_Nasiri24-Jun-07 20:48
memberVahid_Nasiri24-Jun-07 20:48 
QuestionHow to Turn Off Anonymous Authentication Pin
Tom So12-Jan-07 8:41
memberTom So12-Jan-07 8:41 
GeneralUnknown name exception while creating Virtual Directory on remote machine Pin
kdp_1236-Dec-06 17:45
memberkdp_1236-Dec-06 17:45 
GeneralRe: Unknown name exception while creating Virtual Directory on remote machine Pin
pavankumarchakilam1-Apr-10 21:03
memberpavankumarchakilam1-Apr-10 21:03 
GeneralNot works with Add method Pin
Yuri Kiselev22-Nov-06 0:00
memberYuri Kiselev22-Nov-06 0:00 
GeneralRe: Not works with Add method Pin
WIROL18-Oct-07 0:04
memberWIROL18-Oct-07 0:04 
GeneralAnother way of creation and deletion of VD in 2.0 Pin
digitally_urs17-Nov-06 2:35
memberdigitally_urs17-Nov-06 2:35 
GeneralIIS Virtual Directory Pin
Sen K Mathew17-Jul-05 20:12
memberSen K Mathew17-Jul-05 20:12 
GeneralRe: IIS Virtual Directory Pin
avidgator18-Aug-05 15:01
memberavidgator18-Aug-05 15:01 
QuestionHow do I create VD pointing to another site Pin
Kushal Prasad29-Mar-05 20:38
memberKushal Prasad29-Mar-05 20:38 
GeneralI found this version Pin
alan_every18-Dec-03 3:10
memberalan_every18-Dec-03 3:10 
GeneralI am unable to set a path in the real path Pin
vimalkd19-Oct-03 5:11
membervimalkd19-Oct-03 5:11 
GeneralRe: I am unable to set a path in the real path Pin
cuongnle6-Aug-07 22:28
membercuongnle6-Aug-07 22:28 
GeneralRe: I am unable to set a path in the real path Pin
WIROL18-Oct-07 0:09
memberWIROL18-Oct-07 0:09 
GeneralVirtual Directory not showing in Internet Services Manager Pin
SeattleCoder23-Jun-03 11:04
memberSeattleCoder23-Jun-03 11:04 
GeneralRe: Virtual Directory not showing in Internet Services Manager Pin
Anonymous28-Jun-05 0:45
sussAnonymous28-Jun-05 0:45 
QuestionHow to Create a VD in non-Default web Site Pin
JShi21-Jun-03 8:51
sussJShi21-Jun-03 8:51 
AnswerRe: How to Create a VD in non-Default web Site Pin
PhoneTech10-Jul-03 6:22
memberPhoneTech10-Jul-03 6:22 
GeneralApplicationProtection Property. Pin
Kent Moyle28-May-03 17:49
memberKent Moyle28-May-03 17:49 

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

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

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 6 Jul 2001
Article Copyright 2001 by Gaston
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid