.NET
  Home arrow .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 
Moblin 
JMSL Numerical Library 
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? 
.NET

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

    Table of Contents:
  • Managing Windows Indexing Service with Visual Basic.NET Using COM
  • Getting “Indexing service” status information with COM and VB.NET
  • How to change the “start mode” of (or manage) indexing service
  • How to program the index catalogs

  • 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


    Managing Windows Indexing Service with Visual Basic.NET Using COM - How to change the “start mode” of (or manage) indexing service


    (Page 3 of 4 )

    “Starting” the indexing service is different and “start mode” is different.  “Start mode” is the mode which makes the service “auto start” or “manual start” or even be “disabled.”  We can change “Start mode” directly using the “services snap-in” provided by the Microsoft OS.  Now we shall see how to change the same dynamically using COM programming together with .NET.

    Dim obj As New CIODMLib.AdminIndexServerClass

    Private Sub btnConfigure2AutoStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
    btnMakeItAutoStart.Click
            obj.EnableCI(True)
            MessageBox.Show("Made it Autostart")
        End Sub
     
    Private Sub btnMakeItManualStart_Click(ByVal sender As
    System.Object, ByVal e As System.EventArgs) Handles
    btnMakeItManualStart.Click
            obj.EnableCI(False)
            MessageBox.Show("Made it Manual")
        End Sub

    You can observe that the above code got split into two events, one each for “AutoStart” and “ManualStart.”  The “AdminIndexServerClass” mainly contains a method “EnableCI,” which can be used to change the “start mode” of Indexing Service.  It accepts a “Boolean” value (true or false).  A “true” value makes the Indexing Service “auto-start” and vice versa with “false.”

    Now let us see how to change the state of Indexing Service.  I would like to “start” or “stop” the indexing service dynamically through programming.  Let us see how.

    Dim obj As New CIODMLib.AdminIndexServerClass
     
    Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e
    As System.EventArgs) Handles btnStart.Click
            obj.Start()
            MessageBox.Show("Service Started ")
        End Sub
     
        Private Sub btnStop_Click(ByVal sender As System.Object,
    ByVal e As System.EventArgs) Handles btnStop.Click
            obj.Stop()
            MessageBox.Show("Service Stopped")
        End Sub

    I don’t think I need to explain anything about the above code.  I think you can understand that all of the above code (in this section) is also quite different from that of WMI code in my previous article.

    More .NET Articles
    More By Jagadish Chaterjee


       · Hello guys, now you can manage your indexing service right from VB.NET...have a...
     

    .NET ARTICLES

    - More on Commands, Input and the WPF
    - Grouping and Aggregating When Querying LINQ ...
    - Commands, Input and the WPF
    - Keyboard and Ink Input with WPF
    - Mouse Input and the WPF
    - Input with Windows Presentation Foundation
    - Introducing LINQ with XML and Databases
    - An Introduction to LINQ
    - Querying LINQ to SQL: Basics
    - Completing a Simple Storefront with LINQ
    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries
    - Introducing LINQ to SQL Designer using Visua...
    - Beginning LINQ to SQL Using Visual Studio 20...





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