Re: Validate a User Account
How can I validate also an local user... i putted the machine name in txtdomain, but doesnt' work :(
Re: Validate a User Account
Quote:
Originally Posted by
jackdroid
How can I validate also an local user... i putted the machine name in txtdomain, but doesnt' work :(
No sure what you mean but try putting "Local Host" in the txtDamain textbox.
This is only an example.
vb.net Code:
Result = ValidateUser("Nightwalker83", "password", "Local Host")
Re: Validate a User Account
Try a "." instead ...
Also I would suggest using managed code such as this:
vb Code:
Public Function ValidateUser(Username As String, Password As String)
Using context As New System.DirectoryServices.AccountManagement.PrincipalContext(DirectoryServices.AccountManagement.ContextType.Machine)
Return (context.ValidateCredentials(Username, Password))
End Using
End Function
Just whipped up and tested ... local machine only since that's what your using :)
.. oh and you will need to add a reference to System.DirectoryServices.AccountManagement
Kris