By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,417 Members | 904 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,417 IT Pros & Developers. It's quick & easy.

clsWMI

P: n/a
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?
Nov 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
* "scorpion53061" <Its the end of the world as we know it@here.com> scripsit:
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.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a
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

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bu************@ID-208219.news.uni-berlin.de...
* "scorpion53061" <Its the end of the world as we know it@here.com>

scripsit:
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.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3

P: n/a
* "scorpion53061" <Its the end of the world as we know it@here.com> scripsit:
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"?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

P: n/a
> 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......
Nov 20 '05 #5

P: n/a
Cor
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
Nov 20 '05 #6

P: n/a
> 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.......
Nov 20 '05 #7

P: n/a
* "scorpion53061" <Its the end of the world as we know it@here.com> scripsit:
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.


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

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.