Share via


ScriptTask Konstruktor

Definition

Initialisiert eine neue Instanz der ScriptTask-Klasse.

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

Beispiele

Im folgenden Codebeispiel wird mithilfe des Konstruktors ein neues ScriptTask Erstellt.

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

Hinweise

Obwohl Sie den Aufgabenkonstruktor aufrufen können, erstellen Sie die Aufgabe in der Regel als Mitglied eines Pakets.

Im folgenden Beispiel stehen die Eigenschaften und Methoden der ScriptTask Variablen zur Verfügung PropertiesTaskHost. th Weitere Informationen zum Umwandeln der Aufgabe finden Sie in den Anmerkungen 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  

Gilt für: