MessageQueueTask 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 MessageQueueTask 類別的新執行個體。
public:
MessageQueueTask();
public MessageQueueTask();
Public Sub New ()
範例
以下程式碼範例建立一個新的訊息佇列任務。
MessageQueueTask myMSMQ = new MessageQueueTask();
Dim myMSMQ As MessageQueueTask = New MessageQueueTask()
備註
範例程式碼展示了如何呼叫任務建構子。 不過,在大多數情況下,你會以套件成員的身份建立任務。 欲了解更多關於施放任務的資訊,請參閱 中的 Add備註。
Package pkg = new Package();
Executable exec1 = pkg.Executables.Add("STOCK:MSMQTask");
TaskHost th = exec1 as TaskHost;
// You can cast the InnerObject of the TaskHost
// to the specific class.
// For the code samples, te properties of the task are accessed
// by using the Properties collection of the TaskHost.
// MSMQTask myTask = th.InnerObject as MSMQTask;
Dim pkg As Package = New Package()
Dim exec1 As Executable = pkg.Executables.Add("STOCK:MSMQTask")
Dim th As TaskHost = exec1 as TaskHost
' You can cast the InnerObject of the TaskHost
' to the specific class.
' For the code samples, the properties of the task are accessed
' by using the Properties collection of the TaskHost.
' Dim myTask As MSMQTask = th.InnerObject as MSMQTask
的性質與方法 BulkInsertTask 可用變 TaskHost 數 th。