Partager via


WmiDataReaderTask Constructeur

Définition

Initialise une nouvelle instance de la classe WmiDataReaderTask.

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

Exemples

L’exemple de code suivant crée un nouveau WmiDataReaderTask à l’aide du constructeur.

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

Remarques

L’exemple de code montre comment appeler le constructeur de tâche. Toutefois, dans la plupart des cas, vous allez créer la tâche en tant que membre d’un package. Pour plus d’informations sur la conversion de la tâche, consultez les remarques dans Add.

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

Les propriétés et méthodes du fichier WmiDataReaderTask sont disponibles à l’aide de la TaskHost variable. th

S’applique à