
May 27th, 2003, 10:24 AM
|
|
Contributing User
|
|
Join Date: May 2003
Location: Pennsylvania
Posts: 30
Time spent in forums: < 1 sec
Reputation Power: 6
|
|
|
user's Name
I am trying to place a textbox on a web form that will be populated by getting the user's id from their pc.
Listed is the code this works fine in vb.net but in asp.net the users name is ASPNET ?? any help would be helpfull
Declare Function GetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, ByRef nSize As Integer) As Integer
Function GetUser()
Dim Ret As Integer
Dim UserName As String
Dim Buffer As String
Buffer = New String(CChar(" "), 25)
Ret = GetUserName(Buffer, 25)
UserName = Strings.Left(Buffer, InStr(Buffer, Chr(0)) - 1)
GetUser = UserName
End Function
|