对 Active Directory 使用表单验证
http://www.microsoft.com/taiwan/msdn/books/ataglance/secnetht02.htm

解决方案 »

  1.   

    try
    {
      if(true == adAuth.IsAuthenticated(txtDomainName.Text,
                                        txtUserName.Text,
                                        txtPassword.Text))
      {
        // Retrieve the user's groups
        string groups = adAuth.GetGroups();
        // Create the authetication ticket
        FormsAuthenticationTicket authTicket = 
            new FormsAuthenticationTicket(1,  // version
                                          txtUserName.Text,
                                          DateTime.Now, 
                                          DateTime.Now.AddMinutes(60),
                                          false, groups);