Task 建構函式

定義

初始化 Task 類別的新執行個體。

protected:
 Task();
protected Task ();
Protected Sub New ()

範例

下列程式碼範例會使用此函式來建立新的 BulkInsertTask

BulkInsertTask myTask = new BulkInsertTask();  
Dim myTask As BulkInsertTask =  New BulkInsertTask()  

備註

針對繼承自的 Task 工作,每個工作的 [範例] 區段中的程式碼範例會顯示如何呼叫工作的函式。 不過,在大部分情況下,您會將工作建立為封裝的成員。 如需轉換工作的詳細資訊,請參閱中的備註 Add

Package pkg = new Package();  
Executable exec1 = pkg.Executables.Add("STOCK:BulkInsertTask");  
TaskHost th = exec1 as TaskHost;  
// You can cast the InnerObject of the TaskHost  
// to the specific class.  
// For the code samples, the task properties are accessed using  
// the Properties of the TaskHost.  
//BulkInsertTask myTask = th.InnerObject as BulkInsertTask;  
Dim pkg As Package =  New Package()   
Dim exec1 As Executable =  pkg.Executables.Add("STOCK:BulkInsertTask")   
Dim th As TaskHost =  exec1 as TaskHost   
' You can cast the InnerObject of the TaskHost  
' to the specific class.  
' For the code samples, the task properties are accessed using  
' the Properties of the TaskHost.  
'BulkInsertTask myTask = th.InnerObject as BulkInsertTask;  

BulkInsertTask 可以使用變數來使用的屬性和方法 TaskHost th

適用於