using System;
using System.DirectoryServices;
using System.Security.Principal;
using System.Runtime.InteropServices;
using System.Collections;
private System.DirectoryServices.DirectoryEntry AD = null;
private System.Boolean connected = false;
public System.Boolean Connect(string loginPath)
{
try
{
AD = new System.DirectoryServices.DirectoryEntry(loginPath);
connected = true;
}
catch (Exception e)
{
error = true;
connected = false;
errorLog.Append(e.ToString());
}
return connected;
}

