B
Brad Burke
Can I create an asp.net web page that finds the current user by looking at
their Windows login name or are security setting going to limit me?
When a page first opens, can I use code similar to my current VB6 code:
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function GetOSUserName() 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
GetOSUserName = Left$(strUserName, lngLen - 1)
Else
GetOSUserName = vbNullString
End If
End Function
Thanks!
their Windows login name or are security setting going to limit me?
When a page first opens, can I use code similar to my current VB6 code:
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function GetOSUserName() 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
GetOSUserName = Left$(strUserName, lngLen - 1)
Else
GetOSUserName = vbNullString
End If
End Function
Thanks!