Click here to Skip to main content
Click here to Skip to main content

How to create a virtual directory with C#

By , 5 Jul 2001
 

Sample Image - virtualdir.jpg

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

About the Author

Gaston
Web Developer
Uruguay Uruguay
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionDoes not work properly with Windows 7 64 bit and VS 2010 PinmemberJVH35 Oct '11 - 5:33 
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 
GeneralNot works with Add method PinmemberYuri Kiselev22 Nov '06 - 0:00 
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 
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 
GeneralVirtual Directory not showing in Internet Services Manager PinmemberSeattleCoder23 Jun '03 - 11:04 
QuestionHow to Create a VD in non-Default web Site PinsussJShi21 Jun '03 - 8:51 
GeneralApplicationProtection Property. PinmemberKent Moyle28 May '03 - 17:49 
QuestionHow to implement in ASP.NET? PinmemberPhoneTech23 Feb '03 - 6:43 
QuestionHow do you delete Virtual Directory? Pinmemberahaddad20 Feb '03 - 8:18 
GeneralI solved this problem. Pinmemberkind51114 May '02 - 22:16 
GeneralPath not set PinmemberKannan Kalyanaraman17 Mar '02 - 2:32 

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

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