DeliveryChannel Class

Represents a delivery channel for an instance of Notification Services.

Пространство имен: Microsoft.SqlServer.Management.Nmo
Сборка: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Синтаксис

'Декларация
Public NotInheritable Class DeliveryChannel
    Inherits NamedSmoObject
public sealed class DeliveryChannel : NamedSmoObject
public ref class DeliveryChannel sealed : public NamedSmoObject
public final class DeliveryChannel extends NamedSmoObject
public final class DeliveryChannel extends NamedSmoObject

Замечания

A delivery channel represents a specific delivery endpoint, such as an SMTP server. You define delivery channels for an instance of Notification Services.

You must have at least one delivery channel for each delivery protocol your notification applications use to deliver notifications. This includes the standard SMTP and File delivery protocols and any custom protocols defined using the ProtocolDefinition class.

Inheritance Hierarchy

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

Пример

The following examples show how to define a delivery channel for the standard file delivery protocol:

// Define a delivery channel that uses the built-in File protocol
DeliveryChannel fileChannel = 
    new DeliveryChannel(myInstance, "FileChannel");
fileChannel.ProtocolName = "File";

// Define and add arguments for the file delivery channel
DeliveryChannelArgument fileNameArg = 
    new DeliveryChannelArgument(fileChannel, "FileName");
fileNameArg.Value = sampleDirectory + 
    @"\Notifications\FileNotifications.txt";
fileChannel.DeliveryChannelArguments.Add(fileNameArg);

// Add the file delivery channel to the instance
myInstance.DeliveryChannels.Add(fileChannel);
' Define a delivery channel using the built-in File protocol
Dim fileChannel As DeliveryChannel = _
    New DeliveryChannel(myInstance, "FileChannel")
fileChannel.ProtocolName = "File"

' Define and add arguments for the file delivery channel
Dim fileNameArg As DeliveryChannelArgument = _
    New DeliveryChannelArgument(fileChannel, "FileName")
fileNameArg.Value = sampleDirectory + _
    "\Notifications\FileNotifications.txt"
fileChannel.DeliveryChannelArguments.Add(fileNameArg)

' Add the file delivery channel to the instance
myInstance.DeliveryChannels.Add(fileChannel)

The following examples show how to define a delivery channel for the custom delivery protocol. You must also define the custom protocol using the ProtocolDefinition class.

// Define a delivery channel for the custom protocol
DeliveryChannel customChannel = 
    new DeliveryChannel(myInstance, "MyCustomChannel");
customChannel.ProtocolName = "MyCustomProtocol";

// Define and add arguments for the custom delivery channel
DeliveryChannelArgument myArg1 = 
    new DeliveryChannelArgument(customChannel, "Arg1");
myArg1.Value = "Value1";
customChannel.DeliveryChannelArguments.Add(myArg1);

// Add the custom delivery channel to the instance
myInstance.DeliveryChannels.Add(customChannel);
' Define a delivery channel for the custom protocol
Dim customChannel As DeliveryChannel = _
    New DeliveryChannel(myInstance, "MyCustomChannel")
customChannel.ProtocolName = "MyCustomProtocol"

' Define and add arguments for the custom delivery channel
Dim myArg1 As DeliveryChannelArgument = _
    New DeliveryChannelArgument(customChannel, "Arg1")
myArg1.Value = "Value1"
customChannel.DeliveryChannelArguments.Add(myArg1)

' Add the custom delivery channel to the instance
myInstance.DeliveryChannels.Add(customChannel)

Синхронизация потоков

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.

Платформы

Платформы разработки

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

Целевые платформы

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

См. также

Справочник

DeliveryChannel Members
Microsoft.SqlServer.Management.Nmo Namespace

Другие ресурсы

Определение каналов доставки
Настройка протоколов доставки
DeliveryChannel Element (ICF)