Discussion Locked

Urgent!!! Password in VB to match in NT

0 helpful
10 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

A Year full of prosperity for every one.

I have a form in VB wich asks for a user and a password. These need to be compared or validated against the user an password in NT.

Is this possible? and if it is, wher can i find information about?

If any one have code already written about it, could please send it to me.

Thanks a lot everybody

Regards

Tony

10 replies

by rrv

Not advisable to create a window in VB to do that job. Recomended to use API which in turn calls the same windows password verification screen. search in www.msdn.microsoft.com for VB help.

RV

by aong

Tony,

Clarifications on how you want to run the VB pgm. Is the VB program (client) running on the NT box or is it on a desktop PC?

Also specs on the machines + OS (include version) would help.

regards,
A

by supanams

Try to import the function. try code below:

' Information functions: get a connection name, and the current user/computer name
Private Declare Function GetComputerName Lib "Kernel32" Alias "GetComputerNameA" _
(ByVal lpBuffer As String, nSize As Long) As Integer

ublic Function acbGetUser(Optional varErr As Variant) As String

' Get the name of the current network user

Dim strBuffer As String
Dim lngRetval As Long
Dim lngSize As Long

' Pick an arbitrarysize to start with. See comments
' in acbGetConnection to see how this all works.
lngSize = conMaxPath
Do
strBuffer = Space(lngSize)
lngRetval = WNetGetUser(0&, strBuffer, lngSize)
Loop Until lngRetval <> ERROR_MORE_DATA
If lngRetval <> NO_ERROR Then
acbGetUser = ""
Else
acbGetUser = TrimNull(strBuffer)
End If
varErr = lngRetval
End Function

This discussion is closed to new replies.