Visual Basic .NET Forums    

Go Back   Visual Basic .NET Forums > The Break Room > Articles of Interest

VB.NET Forums Newsletter Signup:
Email address:


Articles of Interest Members posting articles of interest others should read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-28-2006, 12:10 PM
JohnH's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2005
Location: Norway
Age: 36
Posts: 8,138
Reputation: 876
JohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond repute
Default WMI Code Creator 1.0

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:
Brief Description
The WMI Code Creator tool allows you to generate VBScript, C#, and VB .NET code that uses WMI to complete a management task such as querying for management data, executing a method from a WMI class, or receiving event notifications using WMI.
On the topic of WMI tools, also don't forget the WMI Tester that is included in Windows system, you can Run it from Start menu (Wbemtest.exe). It's excellent for testing and verifying WQLs when you are uncertain about code or connection.

Most useful link: Windows Management Instrumentation reference at MSDN. (you can also click to get relevant class docs from within WMI Code Creator application)
Attached Images
File Type: jpg wmigen.jpg (49.1 KB, 141 views)
__________________
See this thread about how to use forum markup codes for code blocks etc (present the problem/post properly )
Some useful links: Learning videoes, WMI Code Creator, MSDN, The Code Project, WindowsClient.net, ASP.net, W3 Schools, Regular-Expressions.info, GDI+ FAQ


DR. WEIR: Download it to a non-networked, firewalled computer.
TECHNICIAN: Yes, ma'am.
Reply With Quote
  #2 (permalink)  
Old 09-28-2006, 1:45 PM
Neal's Avatar
VB.NET Forum Admin
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jul 2004
Location: Richmond, VA
Posts: 957
Reputation: 136
Neal done a little coding in his/her timeNeal done a little coding in his/her timeNeal done a little coding in his/her timeNeal done a little coding in his/her time
Default

Awesome! Thanks JohnH!
__________________
Neal Culiner
VB.NET Forum Admin
Reply With Quote
  #3 (permalink)  
Old 11-22-2006, 2:42 AM
Luc's Avatar
Luc Luc is offline
VB.NET Forum Enthusiast
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Nov 2005
Posts: 59
Reputation: 41
Luc is on a distinguished programming path ahead
Default

Thanks it has proven extremly usefull to me!
Reply With Quote
  #4 (permalink)  
Old 11-22-2006, 4:07 AM
JuggaloBrotha's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Jun 2004
Location: Lansing, MI; USA
Age: 24
Posts: 2,996
Reputation: 212
JuggaloBrotha a shining VB.NET starJuggaloBrotha a shining VB.NET starJuggaloBrotha a shining VB.NET starJuggaloBrotha a shining VB.NET starJuggaloBrotha a shining VB.NET star
Default

holy crap, i downloaded it and noticed that there's a really large .cs file, i think it's the VS2003 C# source file for that program.. which means we can customize it as needed

thanx big time JohnH
__________________
There are 3 kinds of people in the world: Those who can count and those who can't.

Windows has a 64 bit GUI for a set of 32 bit extensions on a 16 bit shell for an 8 bit OS using a 4 bit kernel made by a 2 bit company that can't stand 1 bit of competition.

For an extensive list of MS Service packs and extensions: http://www.juggalobrotha.com/
Reply With Quote
  #5 (permalink)  
Old 05-14-2008, 5:29 PM
JohnH's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2005
Location: Norway
Age: 36
Posts: 8,138
Reputation: 876
JohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond repute
Default

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
Usage example:
Code:
GenerateWMIClass("Win32_Printer")
Then add the generated "Win32_Printer.vb" class to the project (Add Existing Item...). As you can see the coding is now far more manageable:
Code:
For Each p As Win32.Printer In Win32.Printer.GetInstances
    p.PrintTestPage()
Next
__________________
See this thread about how to use forum markup codes for code blocks etc (present the problem/post properly )
Some useful links: Learning videoes, WMI Code Creator, MSDN, The Code Project, WindowsClient.net, ASP.net, W3 Schools, Regular-Expressions.info, GDI+ FAQ


DR. WEIR: Download it to a non-networked, firewalled computer.
TECHNICIAN: Yes, ma'am.
Reply With Quote
  #6 (permalink)  
Old 07-24-2008, 5:41 PM
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Jul 2008
Age: 30
Posts: 4
Reputation: 0
Fellia is on a distinguished programming path ahead
Default

Thanks I can use this!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 7:41 AM.




Click to advertise here

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
For advertising opportunities click here.