Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub Form_Load()
Dim ret As Long
Dim c_name As String * 255
Dim u_name As String * 255
'Programda kullanylacak de?i?kenler tanymlanyyor.
Label1.Caption = "Computer Name :"
Label3.Caption = "User Name :"
ret = GetComputerName(c_name, Len(c_name))
If ret = 1 Then
Label2.Caption = c_name
End If
ret = GetUserName(u_name, Len(u_name))
If ret = 1 Then
Label4.Caption = u_name
End If
End Sub