Re: Computername
09.02.2003 16:24:00
Hajo_Zi
Hallo Christianich sehe nun nicht wie Du mit Deinem Code dem Computernamen rauskriegst.
unter NT x1 = Environ("COMPUTERNAME")
ansonsten
computername
Private Const MAX_COMPUTERNAME_LENGTH As Long = 31
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub Form_Load()
Dim dwLen As Long
Dim strString As String
'Create a buffer
dwLen = MAX_COMPUTERNAME_LENGTH + 1
strString = String(dwLen, "X")
'Get the computer name
GetComputerName strString, dwLen
'get only the actual data
strString = Left(strString, dwLen)
'Show the computer name
MsgBox strString
End Sub
Andi_Bln
Gruß Hajo