<%@ Page %>
<script Language="vb" runat="server">
Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
If Not ValidateUser("Login", "Password") Then
End If
End Sub
Function ValidateUser(ByVal Login As String, ByVal Password As String) As Boolean
Dim Entry As DirectoryEntry
Try
Entry = New DirectoryEntry("LDAP://DomainName", Login, Password)
Dim Search As DirectorySearcher = New DirectorySearcher(Entry)
Dim results As SearchResult = Search.FindOne
Return True
Catch
Return False
Finally
Entry.Close()
End Try
End Function
</script>
|