How to import Imports ROOT.CIMV2.Win32

  • Thread starter Thread starter moondaddy
  • Start date Start date
M

moondaddy

I have a c# 2.0 class and am supposed to use:

using ROOT.CIMV2.Win32;

However, I can't figure out what I need to reference so I can use
ROOT.CIMV2.Win32. Can someoen please advise?
 
Hello moondaddy,

I don't understant what are your problem can you explain ?

Sorry for my english I'm French

You can download this software to help you to explore class of root.comv2

http://www.csharpfr.com/codes/EXPLORATEUR-CLASSES-WMI_11600.aspx

After you can use MgmtClassGen.exe utilities, it's a software given whith
visual studio who permit to create a visual studio class from a class of
wmi, it's more easy whith that, i hope it can help you.

Romain
 
Thanks for the reply! I'm looking at some sample code I want to use that
will automatically generate strongly typed names. At the top of the code
file it has this using statement:

using ROOT.CIMV2.Win32;

and ROOT gets a compile error. I followed the instructions to create a
class using the MgmtClassGen.exe from the command prompt, but it wasn't
clear on how to use that generate class in my project. I'm just not clear
on the whole thing.
 
Hello moondaddy,

I'm just working on WMI too.

To use MgmtClassGen.exe, you must type something like that MgmtClassGen.exe
win32_NetworkAdapterConfuguration /l cs (for c#) /p c:\MyBeautifulClass.cs

After you have to import the class in your project and using this statement :

using ROOT.CIMV2.Win32;

After that wmi is more easy ^^

Never the less, I work with VS 2005 on windows xp pro sp2, and i use wmi
method like enableStatic who permit me to change my IP address but it don't
work.

Do you know what is the problem and how i can resolve it ?

Thanks for all

Romain
 
Thanks Romain,

I understand how to create the class, but don't understand what you mean by
'import the class'. its not a dll, its just a cs file. therefore I assume
I just include it in the project. I have done this, but the using
statement:

using ROOT.CIMV2.Win32;

still doesn't compile as it has no idea what 'using ROOT.CIMV2.Win32' is.

can you advise me on this? do I need to reference a dll in my project
references? Or do I need to import a namespace into my project (which begs
another question: I'm moving from VS 2003 and VB to VS2005 and CS. I don't
see any where you can import name spaces. or is that a vb thing and not a
cs thing?).

Since I haven't worked with wmi yet, I cant advise on your IP issue, but
when I cross that bridge, I'll let you know.
 
Back
Top