System information via vb.net???????????????????????????????

  • Thread starter Thread starter John T. Howard
  • Start date Start date
J

John T. Howard

How can I get the System Information via vb.net? At a minimum, I need
that data supplied in Start|All Programs|Accessories|System
Tools|System Information and, preferably the Office Applications
subheader.

Thanks in advance,

John
 
Alot of the system information can be collected by using WMI, make a search for the system.management namespace or WM

GW
 
Can you explain that in simpler term, perhaps a code snippet? I'm
pretty much of a newbie.

Thanks,
John
 
Hi John,

Below code will give you so much system information that it will knock your
socks off:
Dim s As String = _

Registry.LocalMachine.OpenSubKey( _

"SOFTWARE" _

).OpenSubKey( _

"Microsoft" _

).OpenSubKey( _

"Shared Tools" _

).OpenSubKey( _

"MSINFO" _

).GetValue( _

"Path", _

"" _

)

If File.Exists(s) Then

Process.Start(s)

End If

HTH,

Bernie Yaeger
 
Here are some information on collecting drive information through WM

---------------------------------------------------------------------------------
GetDriveSerialNumber - Retrieving the serial number of the specified driv
' Retrieve the serial number of the specified driv
' Note: requires a reference to the System.Management assembl
' Example: MessageBox.Show(GetDriveSerialNumber("D"c)

Function GetDriveSerialNumber(ByVal driveLetter As Char) As Strin
Dim driveFilter As String = "Win32_LogicalDisk=""" & driveLetter.ToString &
":""
Dim drive As New System.Management.ManagementObject(driveFilter
Return drive("VolumeSerialNumber"
End Functio
-----------------------------------------------------------------------------------
GetDriveLabel - Retrieving the label of the specified driv
' Retrieve the drive name (label) of the specified driv
' Note: requires a reference to the System.Management assembl
' Example: MessageBox.Show(GetDriveLabel("D"c)

Function GetDriveLabel(ByVal driveLetter As Char) As Strin
Dim driveFilter As String = "Win32_LogicalDisk=""" & driveLetter.ToString &
":""
Dim drive As New System.Management.ManagementObject(driveFilter
Return drive("VolumeName"
End Function
 
Hi Bernie,

Have once a look to that information path Glen gives, that will knock really
your socks of

:-)

Cor
 
Hi Cor,

I don't find the system.management namespace - am I missing something?

Bernie
 
Hi Bernie,

It is a great namespace, you can get almost everything about a computer and
the OS you never know before.

With this sample you get a disk serial number I think this sample is from
Ken (his style). However the possibilties are endless (do not forget to look
at the link I pasted bellow).

\\\
Imports System.Management
..
Dim disk As New ManagementObject("Win32_LogicalDisk.DeviceID=""C:""")
Dim diskProperty As PropertyData
For Each diskProperty In disk.Properties
Console.WriteLine("{0} = {1}", diskProperty.Name, diskProperty.Value)
Next diskProperty
///

And see this link, than you see it even more I think.

http://msdn.microsoft.com/library/d...emwindowsformssysteminformationclasstopic.asp

Success

Cor
 
All of this is great stuff, but I don't see how to get CPU type and
speed, amount of physical memory, number and size of hard drives, etc.

Am I missing something?

Please keep it simple.

Thanks,

John
 
Hi John,

Look at the thread from Bernie, there I have put this in, however it is not
simple to get.

(When you know how it is of course simple)

Cor
 
Hi Cor,

I believe you that it's a great namespace, but I don't have it! When I try
imports system. management is not a class in the namespace!

Bernie
 
Glenn:

When you say "Note: requires a reference to the System.Management
assembly" , what exactly does that mean?

Thanks,

John
 
Go to the referances section of you project and sellect add referance, then add the system.management.dll, this will allow you to use WMI
 
Hi Oops,

Sorry Bernie, I thought you know this or is there something else wrong.

You have to set a reference to System.Management for it.

Cor
 
Back
Top