ini maksudnya user domain apa cuma login doang?
kalo domain bisa pake api. jadi musti buat module dulu contohnya gini
tambahkan code berikut ke module--------
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Public Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA"
_
(ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function LogonUser Lib "advapi32.dll" _
Alias "LogonUserA" (ByVal lpszUsername As String, _
ByVal lpszDomain As String, ByVal lpszPassword As String, _
ByVal dwLogonType As Long, ByVal dwLogonProvider As Long, _
phToken As Long) As Long
Private Declare Function ImpersonateLoggedOnUser Lib "advapi32.dll" _
(ByVal hToken As Long) As Long
Private Declare Function RevertToSelf Lib "advapi32.dll" () As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long)
As Long
Public Function LoginDomain(User As String, pass As String, domain As String)
As Boolean
Dim lngTokenHandle As Long
Dim blnResult As Boolean
blnResult = RevertToSelf()
blnResult = LogonUser(User, domain, pass, 2, 0, lngTokenHandle)
blnResult = ImpersonateLoggedOnUser(lngTokenHandle)
CloseHandle (lngTokenHandle)
LoginDomain = blnResult
blnResult = RevertToSelf()
End Function
Public Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If (lngX > 0) Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = vbNullString
End If
End Function
----------end of module---------------
nah nanti tinggal panggil function logindomain aja
misalnya
if logindomain (userid,password,domain)=true then
<hasilnya>
else
msgbox "error"
end if
gitu.........
semoga membantu..............
trus
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Non-text portions of this message have been removed]