![]() |
|
[TUT] Get Computer Info - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework) +--- Thread: [TUT] Get Computer Info (/Thread-TUT-Get-Computer-Info) |
[TUT] Get Computer Info - TeraByTe - 06-21-2011 You will need: VB 2008/2010 (I'm using 2008) 8 Textboxes 8 Labels What to edit: ![]() 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 ) RE: [TUT] Get Computer Info - TeraByTe - 06-21-2011 Thanks for your feedback. RE: [TUT] Get Computer Info - JuiceKing - 06-25-2011 Very nice! Do you can find the code to get info: IP adress,MAC Adress on your computer?
RE: [TUT] Get Computer Info - 1234hotmaster - 06-25-2011 (06-25-2011, 04:18 PM)JuiceKing Wrote: Very nice! 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)RE: [TUT] Get Computer Info - JuiceKing - 06-26-2011 (06-25-2011, 05:17 PM)1234hotmaster Wrote:(06-25-2011, 04:18 PM)JuiceKing Wrote: Very nice! Thanks...nice work, but this is for no-ip? 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: RE: [TUT] Get Computer Info - blowdoof - 06-26-2011 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 Subdon't forget to add a reference to system.management.dll RE: [TUT] Get Computer Info - JuiceKing - 06-26-2011 (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 ;-) Thank you very much! :thumbs: |