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
.
IISManager isMang = new IISManager();
isMang.Connect();
try
{
isMang.CreateVirtualDirectory(txtName.Text,txtPath.Text);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}