Visual Basic - Funcion para recibir nombre de sesion en VB6??

Life is soft - evento anual de software empresarial
 
Vista:

Funcion para recibir nombre de sesion en VB6??

Publicado por Juan Antonio (3 intervenciones) el 02/05/2007 11:26:52
Necesito tomar el nombre de sesion en el que se encuentre el usuario para mostrarlo en un textbox en VB6, hay alguna funcion que me tome dicho nombre??
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Funcion para recibir nombre de sesion en VB6??

Publicado por JuanFRy (14 intervenciones) el 03/05/2007 07:41:30
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
Private Function NombreUsuarioWindows() AS String
Dim NomUSU as string
Dim sBuffer As String
Dim lSize As Long
sBuffer = Space$(255)
lSize = Len(sBuffer)
Call GetUserName(sBuffer, lSize)
If lSize > 0 Then
NomUSU = Left$(sBuffer, lSize)
Else
NomUSU = vbNullString
End If
NombreUsuarioWindows = NomUsu
End Function
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar