Visual Basic - recoger nombre de usuario activo

Life is soft - evento anual de software empresarial
 
Vista:

recoger nombre de usuario activo

Publicado por ivan (1039 intervenciones) el 25/05/2006 09:09:36
hola me gustaria saber como puedo hacer en VB6 para recoger el nombre de usuario y la clave del usuario activo (inicio de sesion).
alguien me ayuda? gracias
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:recoger nombre de usuario activo

Publicado por ivan (1039 intervenciones) el 25/05/2006 16:09:34
'LAS SIGUIENTES LINEAS DE CODIGO SE UTILIZAN PARA CONSEGUIR EL USUARIO QUE HA INICIADO SESION
Dim strTemp As String, strUserName As String
'Create a buffer
strTemp = String(100, Chr$(0))
'Get the temporary path
GetTempPath 100, strTemp
'strip the rest of the buffer
strTemp = Left$(strTemp, InStr(strTemp, Chr$(0)) - 1)

'Create a buffer
strUserName = String(100, Chr$(0))
'Get the username
GetUserName strUserName, 100
'strip the rest of the buffer
strUserName = Left$(strUserName, InStr(strUserName, Chr$(0)) - 1)

'Show the temppath and the username
'MsgBox "Hello " + strUserName + Chr$(13) + "The temp. path is " + strTemp
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