다음을 통해 공유


DeliveryChannel Constructor (Instance, String)

Initializes a new instance of the DeliveryChannel class with an Instance and a name.

네임스페이스: Microsoft.SqlServer.Management.Nmo
어셈블리: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

구문

‘선언
Public Sub New ( _
    instance As Instance, _
    name As String _
)
public DeliveryChannel (
    Instance instance,
    string name
)
public:
DeliveryChannel (
    Instance^ instance, 
    String^ name
)
public DeliveryChannel (
    Instance instance, 
    String name
)
public function DeliveryChannel (
    instance : Instance, 
    name : String
)

매개 변수

  • name
    A String of up to 64 characters that specifies the name of the DeliveryChannel object.

    You cannot change the name. To rename a delivery channel, you must remove the delivery channel and then add a new delivery channel that has the new name.

주의

업데이트된 텍스트:2005년 12월 5일

The delivery channel name must be unique within the instance of Notification Services. Names are not case-sensitive. For example, Notification Services does not distinguish between "EmailChannel" and "emailchannel."

Delivery channel names cannot contain the following characters: open bracket ([), close bracket (]), quotation mark ("), single quote ('), backslash (\), and forward slash (/).

You also must set the ProtocolName property.

The following example shows how to use this constructor when defining 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)

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

DeliveryChannel Class
DeliveryChannel Members
Microsoft.SqlServer.Management.Nmo Namespace

관련 자료

배달 채널 정의
DeliveryChannel Element (ICF)