Help - How long it would take to write a WMI Provider in C#.NET 4.0?
I am going to write a WMI Provider for getting battery information using C#.NET 4.0. Can you any one tell me how long it would take to write? . I need 开发者_高级运维to support XP, Windows 7 and Server 2008.
I also need to implement the Interface to the battery to get the additional information which Win32_battery will not provide.
I am a inexperienced Programmer. But i have little idea about WMI Concepts
Thanks In advance..
Although WMI can seem a a little counter-intuitive for some programmers used to functionality we get in the .NET Framework, it is really quite simple. We had to do some WMI work for Hyper-V and we found a fairly generic sample we used to get started here:
http://blogs.technet.com/b/richard_macdonald/archive/2008/08/11/3103559.aspx
I think from the above you can see it won't take very long at all, it should be in the hours, if that. The Win32_Battery class is very simple, (here is an example). However, if you want to go deeper into WMI, I'd recommend you use the WMI CIM Studio from the WMI Administrative Tools
WMI Tools include: WMI CIM Studio: view and edit classes, properties, qualifiers, and instances in a CIM repository; run selected methods; generate and compile MOF files. WMI Object Browser: view objects, edit property values and qualifiers, and run methods.
It takes as long as it takes. An experienced programmer who deals with WMI providers regularly can probably do it quickly, especially if he has code from previous projects that he can reuse. An inexperienced programmer, or an experienced programmer whose experience lies in other areas, is going to take longer.
精彩评论