次の方法で共有


DeliveryChannel Constructor (Instance, String)

Instance および名前を使用して、DeliveryChannel クラスの新しいインスタンスを初期化します。

名前空間: Microsoft.SqlServer.Management.Nmo
アセンブリ: Microsoft.SqlServer.Smo (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
    DeliveryChannel オブジェクトの名前を示す、最大 64 文字の String です。

    名前は変更できません。配信チャネルの名前を変更するには、配信チャネルを削除してから、新しい名前を持つ新しい配信チャネルを追加する必要があります。

解説

更新されたテキスト :2005 年 12 月 5 日

配信チャネル名は、Notification Services のインスタンス内で一意である必要があります。名前の大文字と小文字は区別されません。たとえば、"EmailChannel" と "emailchannel" は Notification Services によって区別されません。

配信チャネル名に使用できない文字は、左角かっこ ([)、右角かっこ (])、二重引用符 (")、単一引用符 (')、円記号 (\)、およびスラッシュ (/) です。

ProtocolName プロパティも設定する必要があります。

使用例

次の例は、このコンストラクタを使用して、標準のファイル配信プロトコルの配信チャネルを定義する方法を示しています。

// 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 要素 (ICF)