![]() |
Click here to advertise with us
|
|
|||||||
| Articles of Interest Members posting articles of interest others should read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
I just came across this WMI Code Creator tool released by Microsoft 2005. First test quickly generated useful code for me. The generated code is version .Net 1.1, but useful in .Net 2.0 too because System.Management namespace wasn't changed much. Current download link.
Quote:
Most useful link: Windows Management Instrumentation reference at MSDN. (you can also click to get relevant class docs from within WMI Code Creator application)
__________________
Some useful links: Learning videoes, Code Samples, WMI Code Creator, MSDN, The Code Project, WindowsClient.net, ASP.net, W3 Schools, Regular-Expressions.info, GDI+ FAQ
How to format posts with code blocks etc - present the problem/post properly ![]() |
|
||||
|
Did you know you can easily generate strongly typed classes for all WMI classes? There is a .Net tool called "Mgmtclassgen.exe" that does this, it can also be done with this short code:
Code:
Public Shared Sub GenerateWMIClass(ByVal name As String)
Dim m As New Management.ManagementClass(name)
m.GetStronglyTypedClassCode(Management.CodeLanguage.VB, name & ".vb", "Win32")
m.Dispose()
End Sub
Code:
GenerateWMIClass("Win32_Printer")
Code:
For Each p As Win32.Printer In Win32.Printer.GetInstances
p.PrintTestPage()
Next
__________________
Some useful links: Learning videoes, Code Samples, WMI Code Creator, MSDN, The Code Project, WindowsClient.net, ASP.net, W3 Schools, Regular-Expressions.info, GDI+ FAQ
How to format posts with code blocks etc - present the problem/post properly ![]() |
|
||||
|
A note about the GetStronglyTypedClassCode generator, it usually produce minor code errors, typically "value = Nothing" with message:
Quote:
__________________
Some useful links: Learning videoes, Code Samples, WMI Code Creator, MSDN, The Code Project, WindowsClient.net, ASP.net, W3 Schools, Regular-Expressions.info, GDI+ FAQ
How to format posts with code blocks etc - present the problem/post properly ![]() |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|