Deleting Crawl Rule




Go back to index

How to delete crawl rule


Following code block explains how to programmatically delete crawl rule in SSP.

      using System;
      using SPTool.Library;
      
      namespace SPTool.Test
      {
          class Program
          {
              static void Main(string[] args)
              {
                  SPTSharedServiceProvider ssp = new SPTSharedServiceProvider("http://sptool:5000/ssp/admin");

                  // Delete Crawl Rule
                  SPTReturn returnObj = ssp.DeleteCrawlRule("http://sptool/");
                  
                  // Check the status of deleting crawl rule
                  if (returnObj.State == SPTState.Success)
                  {
                      // Crawl rule deleted successfully
                  }
                  else
                  {
                      // Deleting crawl rule failed
                  }
              }
          }
      }


Go back to index