Solved

Display System Information

Posted on 2006-11-13
2
194 Views
Last Modified: 2010-04-16
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
0
Comment
Question by:directred
2 Comments
 
LVL 7

Accepted Solution

by:
Dimandja earned 50 total points
ID: 17930980
0
 
LVL 5

Expert Comment

by:sivachirravuri
ID: 17935772
'VB.NET Code
Dim result As String

'Retrieve the NetBIOS name.
result = System.Environment.MachineName

'Display the results to the console window.
Console.WriteLine("NetBIOS Name = {0}", result)

'Retrieve the DNS name.
result = System.Net.Dns.GetHostByName("LocalHost").HostName

'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, lngBufSize)
  If lngStatus <> 0 Then
     MsgBox ("Computer name is: " & Left(strBuffer, lngBufSize))
  End If
End Sub
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question