SunQuest
 
       Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 3 - Managing Windows Indexing Service with Vis...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Managing Windows Indexing Service with Visual Basic.NET using WMI
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 10
    2005-10-19

    Table of Contents:
  • Managing Windows Indexing Service with Visual Basic.NET using WMI
  • How to work with/manage Indexing Service
  • Getting "Indexing service" information with WMI and VB. NET
  • Getting a few other properties of "Indexing service" with WMI and VB. NET
  • Managing "Indexing service" with WMI and VB. NET
  • Passing input parameters to WMI for managing Indexing Service

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    Managing Windows Indexing Service with Visual Basic.NET using WMI - Getting "Indexing service" information with WMI and VB. NET


    (Page 3 of 6 )

    Can we manage/access "Indexing service" directly from within .NET (natively)? .NET natively doesn't support access to Indexing service. So, we need to extend our .NET application to interact with either WMI or COM to manage/access the "indexing service."

    WMI is a good emerging technology from Microsoft for their support to WBEM (Web Based Enterprise Management). For a complete understanding of WMI together with .NET programming, I suggest you go through my series "WMI programming using Visual Basic.NET." Once you are familiar with at least the first two parts in that series, there is no doubt that you will be able to understand this article easily.

    The downloadable solution contains a "WinForms" application, which interacts with the "Indexing Service" using pure WMI. It is important to note that you need to add a reference to "System.Management" namespace to your project, when you are working with WMI (and also import it at the top).

    Let us go through a small code fragment, which I used to retrieve information from an "Indexing Service."

    Private Sub btnCaption_Click(ByVal sender As System.Object, ByVal
    e As System.EventArgs) Handles btnCaption.Click
            Dim LateBoundObject As ManagementObject
            LateBoundObject = New ManagementObject(Nothing, New
    ManagementPath
    ("\\SERVER\root\CIMV2:Win32_Service.Name=""CiSvc"""), Nothing)
            MessageBox.Show(CType (LateBoundObject("caption"),
    String))
            LateBoundObject.Dispose()
       End Sub

    Within the above code, I am creating a "ManagementObject" (an object related to WMI) and then assigning the path of the indexing service ("CiSvc") object to the "ManagementObject". You can also find/list all the services along with their names using WMI and Visual Basic.NET (which is demonstrated in "WMI programming using Visual Basic.NET" series). For now, we concentrate only on the "indexing service."

    The WMI class "Win32_Service" in "root\CIMV2" namespace has a property "caption", which gives the title/caption of that service. To retrieve that, I simply used the property "caption" with the management object created. And finally I disposed the "ManagementObject".

    More Visual Basic.NET Articles
    More By Jagadish Chaterjee


       · Hello guys...you can now manage indexing service dynamically...just go through the...
     

    VISUAL BASIC.NET ARTICLES

    - Movement and Player Statistics in a VB.NET T...
    - Creating and Drawing a Game Map in VB.NET
    - Working with Classes and Properties for Game...
    - Working with Loops, Arrays, and Collections ...
    - Learning Loops in VB.NET for Game Development
    - Learning VB.NET: Working with Variables, Con...
    - The Basics of VB.NET Through Text Game Devel...
    - Learning VB.NET Through Text Game Development
    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...
    - Shadowing using Shadows in Visual Basic.NET ...
    - Overloading and Overriding in Visual Basic.N...
    - More on Controlling Windows Fax Services Usi...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway