다음을 통해 공유


HostDistributionRuleCollection.RemoveRule Method

Removes the specified HostDistributionRule from the Search service application and the collection.

Namespace:  Microsoft.Office.Server.Search.Administration
Assembly:  Microsoft.Office.Server.Search (in Microsoft.Office.Server.Search.dll)

Syntax

'Declaration
Public Sub RemoveRule ( _
    hostName As String, _
    crawlDatabaseGuid As Guid _
)
'Usage
Dim instance As HostDistributionRuleCollection
Dim hostName As String
Dim crawlDatabaseGuid As Guid

instance.RemoveRule(hostName, crawlDatabaseGuid)
public void RemoveRule(
    string hostName,
    Guid crawlDatabaseGuid
)

Parameters

Exceptions

Exception Condition
ArgumentOutOfRangeException

The specified host name is null .

-or-

The specified host name is an empty string.

-or-

The specified host name exceeds 250 characters in length.

-or-

The specified crawl database GUID is null or empty.

Remarks

This method uses a stored procedure to remove the rule from the search administration database. Your code should be able to handle an exception from this operation.

See Also

Reference

HostDistributionRuleCollection Class

HostDistributionRuleCollection Members

Microsoft.Office.Server.Search.Administration Namespace