directred
asked on
Display System Information
I am writing a small app so it will display certain information about my PC. What is the syntax. The sort of system information would be like computername, ip address, physical memory, name of hard drive etc. I know there is a syntax out there but I have forgotten as never used it before
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dim result As String
'Retrieve the NetBIOS name.
result = System.Environment.Machine
'Display the results to the console window.
Console.WriteLine("NetBIOS
'Retrieve the DNS name.
result = System.Net.Dns.GetHostByNa
'Display the results to the console window.
Console.WriteLine("DNS Name = {0}", result)
'Visual Basic - Display computer Name
Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub Command1_Click()
Dim strBuffer As String
Dim lngBufSize As Long
Dim lngStatus As Long
lngBufSize = 255
strBuffer = String$(lngBufSize, " ")
lngStatus = GetComputerName(strBuffer,
If lngStatus <> 0 Then
MsgBox ("Computer name is: " & Left(strBuffer, lngBufSize))
End If
End Sub