RE:Necesit saver el Nombre del PC
Para el nombre de la PC y para el Nombre del Usuario a la vez
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, _
nSize As Long) As Long
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, _
nSize As Long) As Long
Function Ordenador() As String
Dim Nombre As String * 255, Respuesta As Long, Longitud As Long, Res As Long
Nombre = ""
Longitud = Len(Nombre)
Res = GetComputerName(Nombre, Longitud)
If Res And Longitud > 0 Then
Ordenador = Left$(Nombre, Longitud)
Else
Ordenador = "No encontrado"
End If
End Function
Function Usuario() As String
Dim Nombre As String * 255, Respuesta As Long, Longitud As Long, Res As Long
Nombre = ""
Longitud = Len(Nombre)
Res = GetUserName(Nombre, Longitud)
If Res And Longitud > 0 Then
Usuario = Left$(Nombre, Longitud)
Else
Usuario = "No encontrado"
End If
End Function
Private Sub Command1_Click()
MsgBox Ordenador & " - " & Usuario
End Sub