clsWMI

  • Thread starter Thread starter scorpion53061
  • Start date Start date
S

scorpion53061

It says this is not defined though I have for imports:

Imports System.Management
Imports System
Imports System.Configuration.Install
Imports System.Management.Intrumentation

What am I missing?
 
* "scorpion53061 said:
It says this is not defined though I have for imports:

Imports System.Management
Imports System
Imports System.Configuration.Install
Imports System.Management.Intrumentation

What's 'clsWMI'? It's not part of the .NET Framework.
 
Sorry Herfried I should have posted code and a link.
The link is:

http://www.freevbcode.com/ShowCode.asp?ID=4571

More information: This class shows you how to use WMI to get some basic
system information in .NET. It demonstrates only a small subset of the
features within WMI. You must include a reference to system.management to
use it. Below is a sample of how to use the class:
Dim objWMI As New clsWMI()
With objWMI
Debug.WriteLine("Computer Name = " & .ComputerName)
Debug.WriteLine("Computer Manufacturer = " & .Manufacturer)
Debug.WriteLine("Computer Model = " & .Model)
Debug.WriteLine("OS Name = " & .OsName)
Debug.WriteLine("OS Version = " & .OSVersion)
Debug.WriteLine("System Type = " & .SystemType)
Debug.WriteLine("Total Physical Memory = " & .TotalPhysicalMemory)
Debug.WriteLine("Windows Directory = " & .WindowsDirectory)
End With
 
* "scorpion53061 said:
Sorry Herfried I should have posted code and a link.
The link is:

http://www.freevbcode.com/ShowCode.asp?ID=4571

More information: This class shows you how to use WMI to get some basic
system information in .NET. It demonstrates only a small subset of the
features within WMI. You must include a reference to system.management to
use it. Below is a sample of how to use the class:

Does it work now? Did you add a reference to "System.Management.dll"?
 
Does it work now? Did you add a reference to "System.Management.dll"?

I did add a reference and have my import statement like I said before. It
still redlines the clsWMI and says it is undefined.

Thanks for your help.

baffling......
 
Hi Scorpion,

I did look for you at that link, are you sure you did copy that class also
that is beneath the code you are using on that page?

Cor
 
I did look for you at that link, are you sure you did copy that class also
that is beneath the code you are using on that page?

aieeeeeeeeeeeeeeeeeeeee

I am embarressed.......
 
* "scorpion53061 said:
I did add a reference and have my import statement like I said before. It
still redlines the clsWMI and says it is undefined.

Did you copy the whole code showed on the website (including the
implementation of the class 'clsWMI' into your project?
 
Back
Top