Udostępnij za pośrednictwem


Właściwość Package.CreatorComputerName

Pobiera lub ustawia nazwę komputera, na którym pakiet został utworzony.

Przestrzeń nazw:  Microsoft.SqlServer.Dts.Runtime
Zestaw:  Microsoft.SqlServer.ManagedDTS (w Microsoft.SqlServer.ManagedDTS.dll)

Składnia

'Deklaracja
Public Property CreatorComputerName As String
    Get
    Set
'Użycie
Dim instance As Package
Dim value As String

value = instance.CreatorComputerName

instance.CreatorComputerName = value
public string CreatorComputerName { get; set; }
public:
property String^ CreatorComputerName {
    String^ get ();
    void set (String^ value);
}
member CreatorComputerName : string with get, set
function get CreatorComputerName () : String
function set CreatorComputerName (value : String)

Wartość właściwości

Typ: System.String
A ciąg zawiera nazwę komputera.

Przykłady

W poniższym przykładzie ładuje pakiet z folderu przykładów i następnie pobiera informacje o pakiecie, takie jak jego CreationDate, CreatorComputerName, i CreatorName.

static void Main(string[] args)
        {
            // The variable pkg points to the location
            // of the ExecuteProcess package sample 
            // that is installed with the samples.
            string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";

            Application app = new Application();
            Package p = app.LoadPackage(pkg, null);

            //Retrieve creation information about the package.
            DateTime createDate = p.CreationDate;
            String computerCreated = p.CreatorComputerName;
            String creatorName = p.CreatorName;

            Console.WriteLine("Package creation date = " + createDate);
            Console.WriteLine("Creation Computer = " + computerCreated);
            Console.WriteLine("Creator Name = " + creatorName);
        }
Shared  Sub Main(ByVal args() As String)
            ' The variable pkg points to the location
            ' of the ExecuteProcess package sample 
            ' that is installed with the samples.
            Dim pkg As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx" 
 
            Dim app As Application =  New Application() 
            Dim p As Package =  app.LoadPackage(pkg,Nothing) 
 
            'Retrieve creation information about the package.
            Dim createDate As DateTime =  p.CreationDate 
            Dim computerCreated As String =  p.CreatorComputerName 
            Dim creatorName As String =  p.CreatorName 
 
            Console.WriteLine("Package creation date = " + createDate)
            Console.WriteLine("Creation Computer = " + computerCreated)
            Console.WriteLine("Creator Name = " + creatorName)
End Sub

Przykładowe dane wyjściowe:

Package creation date = 5/5/2003 5:46:00 PM

Creation Computer =

Creator Name =