共用方式為


ProtocolDefinition Class

Represents a custom delivery protocol for an instance of Notification Services.

命名空間: Microsoft.SqlServer.Management.Nmo
組件: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

語法

'宣告
Public NotInheritable Class ProtocolDefinition
    Inherits NamedSmoObject
public sealed class ProtocolDefinition : NamedSmoObject
public ref class ProtocolDefinition sealed : public NamedSmoObject
public final class ProtocolDefinition extends NamedSmoObject
public final class ProtocolDefinition extends NamedSmoObject

備註

When you configure an instance of Notification Services, you must define any custom delivery protocols used by the instance's applications. You do not need to define the built-in File and Simple Mail Transfer Protocol (SMTP) delivery protocols.

For custom delivery protocols based on the IDeliveryProtocol interface, you need to provide both the fully qualified class name that implements the custom delivery protocol and the name of the assembly that contains the class.

For custom delivery protocols based on the IHttpProtocolProvider interface, just specify HttpExtension for the class name. Do not specify an assembly name. For more information, see Protocol Element (ICF).

Inheritance Hierarchy

System.Object
   Microsoft.SqlServer.Management.Smo.SmoObjectBase
     Microsoft.SqlServer.Management.Smo.SqlSmoObject
       Microsoft.SqlServer.Management.Smo.NamedSmoObject
        Microsoft.SqlServer.Management.Nmo.ProtocolDefinition

範例

The following examples show how to declare a custom delivery protocol and add it to an instance of Notification Services:

ProtocolDefinition customProtocol = 
    new ProtocolDefinition(myInstance, "MyCustomProtocol");
customProtocol.ClassName = "MyNamespace.MyProtocolClass";
customProtocol.AssemblyName = @"C:\NS\Full\MyCustomComponents.dll";
myInstance.ProtocolDefinitions.Add(customProtocol);
Dim customProtocol As ProtocolDefinition = _
    New ProtocolDefinition(myInstance, "MyCustomProtocol")
customProtocol.ClassName = "MyNamespace.MyProtocolClass"
customProtocol.AssemblyName = _
    "C:\NS\Full\MyCustomComponents.dll"
myInstance.ProtocolDefinitions.Add(customProtocol)

執行緒安全性

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

ProtocolDefinition Members
Microsoft.SqlServer.Management.Nmo Namespace

其他資源

定義自訂傳遞通訊協定
Protocol Element (ICF)