Linguaggio

ScriptTask Costruttore

Definizione

Inizializza una nuova istanza della classe ScriptTask.

public:
 ScriptTask();
public ScriptTask();
Public Sub New ()

Esempio

Il seguente esempio di codice crea un nuovo ScriptTask usando il costruttore.

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

Commenti

Anche se puoi chiamare il task builder, di solito crei il task come membro di un pacchetto.

Nel seguente esempio, le proprietà e i metodi di sono ScriptTask disponibili usando Properties la TaskHost variabile, th. Per maggiori informazioni sull'incantazione del compito, vedi le osservazioni in Add.

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

Si applica a