Login Register






[TUT] Get Computer Info filter_list
Author
Message
[TUT] Get Computer Info #1
You will need:

VB 2008/2010 (I'm using 2008)
8 Textboxes
8 Labels

What to edit:
[Image: untitled.png]

It's too much to explain so make it look like that.
All textboxes are "ReadOnly"

Codes:

In Form_1:
Code:
TextBox1.Text = System.Environment.MachineName ' This tells you your machine name. TextBox2.Text = My.Computer.Info.OSFullName ' This tells you your operation system's full name. TextBox3.Text = My.Computer.Info.OSPlatform ' This tells you your operation system's platform TextBox4.Text = My.Computer.Info.OSVersion ' This tells you your operation system's platform TextBox5.Text = My.Computer.Info.AvailablePhysicalMemory ' This tells you your available physical memory. TextBox6.Text = My.Computer.Info.AvailableVirtualMemory ' This tells you your available virtual memory. TextBox7.Text = My.Computer.Info.TotalPhysicalMemory ' This tells you your total physical memory. TextBox8.Text = My.Computer.Info.TotalVirtualMemory ' This tells you your total virtual memory.

Now your done! It's all self explanatory!
When you now open your program, it tells you your computer info automatically!

Tutorial not made by me ( this time )
[Image: mybbsig.php]

Reply

RE: [TUT] Get Computer Info #2
Thanks for your feedback.
[Image: mybbsig.php]

Reply

RE: [TUT] Get Computer Info #3
Very nice! Biggrin Do you can find the code to get info: IP adress,MAC Adress on your computer? Smile

Reply

RE: [TUT] Get Computer Info #4
(06-25-2011, 04:18 PM)JuiceKing Wrote: Very nice! Biggrin Do you can find the code to get info: IP adress,MAC Adress on your computer? Smile

Code:
Dim wc As New System.Net.WebClient : Dim IP As String = wc.DownloadString("http://dynupdate.no-ip.com/ip.php")

Example:
Code:
MsgBox(IP)
Pierce the life fibers with your drill.

Reply

RE: [TUT] Get Computer Info #5
(06-25-2011, 05:17 PM)1234hotmaster Wrote:
(06-25-2011, 04:18 PM)JuiceKing Wrote: Very nice! Biggrin Do you can find the code to get info: IP adress,MAC Adress on your computer? Smile

Code:
Dim wc As New System.Net.WebClient : Dim IP As String = wc.DownloadString("http://dynupdate.no-ip.com/ip.php")

Example:
Code:
MsgBox(IP)

Thanks...nice work, but this is for no-ip? Biggrin Very useful code...
Do you can get the code to get the ip adress of computer but not no-ip...?
P.S. Thanks bro! :thumbs:

Reply

RE: [TUT] Get Computer Info #6
Sure you can get the ip adress of the computer... but the provided solution seems better to me, since getting the local ip can be tricky (because most pc's nowadays have more than 1 NIC... wired, wireless, virtual, etc..) so you could end up with several ip's, finally not knowing which one is the 'live' ip.. besides that, it gives you the local ip, not the wan ip ;-)
sorry, forgot the code..
using WMI to get all active NIC's and their ip addresses:

Code:
Private Sub iptest() Dim mc As System.Management.ManagementClass Dim mo As ManagementObject mc = New ManagementClass("Win32_NetworkAdapterConfiguration") Dim moc As ManagementObjectCollection = mc.GetInstances() Dim ips As String() For Each mo In moc If mo.Item("IPEnabled") = True Then ips = mo.Item("IPAddress") End If Next For i = 0 To ips.GetUpperBound(0) MessageBox.Show(ips(i)) Next End Sub

don't forget to add a reference to system.management.dll

Reply

RE: [TUT] Get Computer Info #7
(06-26-2011, 11:38 AM)blowdoof Wrote: Sure you can get the ip adress of the computer... but the provided solution seems better to me, since getting the local ip can be tricky (because most pc's nowadays have more than 1 NIC... wired, wireless, virtual, etc..) so you could end up with several ip's, finally not knowing which one is the 'live' ip.. besides that, it gives you the local ip, not the wan ip ;-)
sorry, forgot the code..
using WMI to get all active NIC's and their ip addresses:

Code:
Private Sub iptest() Dim mc As System.Management.ManagementClass Dim mo As ManagementObject mc = New ManagementClass("Win32_NetworkAdapterConfiguration") Dim moc As ManagementObjectCollection = mc.GetInstances() Dim ips As String() For Each mo In moc If mo.Item("IPEnabled") = True Then ips = mo.Item("IPAddress") End If Next For i = 0 To ips.GetUpperBound(0) MessageBox.Show(ips(i)) Next End Sub

don't forget to add a reference to system.management.dll

Thank you very much! :thumbs:

Reply