Compartir a través de


ForEachLoop.GetPackagePath Método

Definición

Devuelve una cadena que contiene la ruta de acceso relativa a la ubicación del paquete.

public:
 virtual System::String ^ GetPackagePath();
public string GetPackagePath ();
abstract member GetPackagePath : unit -> string
override this.GetPackagePath : unit -> string
Public Function GetPackagePath () As String

Devoluciones

Cadena que contiene la ruta de acceso al paquete.

Implementaciones

Ejemplos

En el ejemplo de código siguiente se crea un ForEachLoopobjeto , se establecen algunas propiedades mediante la Properties colección y se recupera la ruta de acceso del paquete.

// Create the new package.  
Package package = new Package();  
// Add variables.  
package.Variables.Add("Id", false, "User", 0);  
// Create ForEachLoop task  
Executables executables = package.Executables;  
ForEachLoop forEachLoop = executables.Add("STOCK:FOREACHLOOP") as ForEachLoop;  
// Set properties on the ForEachLoop, like name and description.  
// Show how to set them using the Properties collection.  
forEachLoop.Properties["Name"].SetValue(forEachLoop, "ForEachLoop Container");  
forEachLoop.Properties["Description"].SetValue(forEachLoop, "ForEachLoop Container");  

// Retrieve the package path of the loop.  
String path = forEachLoop.GetPackagePath();  
Console.WriteLine("Package path: {0}", path);  
' Create the new package.  
Dim package As Package =  New Package()   
' Add variables.  
package.Variables.Add("Id", False, "User", 0)  
' Create ForEachLoop task  
Dim executables As Executables =  package.Executables   
Dim forEachLoop As ForEachLoop =  executables.Add("STOCK:FOREACHLOOP") as ForEachLoop   
' Set properties on the ForEachLoop, like name and description.  
' Show how to set them using the Properties collection.  
forEachLoop.Properties("Name").SetValue(forEachLoop, "ForEachLoop Container")  
forEachLoop.Properties("Description").SetValue(forEachLoop, "ForEachLoop Container")  

' Retrieve the package path of the loop.  
Dim path As String =  forEachLoop.GetPackagePath()   
Console.WriteLine("Package path: {0}", path)  

Salida del ejemplo:

Ruta de acceso del paquete: \Package\ForEachLoop Container

Se aplica a