Freigeben über


DeploymentBaseOptions.Password Eigenschaft

Definition

Ruft das Kennwort ab, das für den Zugriff auf den Bereitstellungsspeicherort verwendet wird, oder legt es fest.

public:
 property System::String ^ Password { System::String ^ get(); void set(System::String ^ value); };
public string Password { get; set; }
member this.Password : string with get, set
Public Property Password As String

Eigenschaftswert

Eine Zeichenfolge, die das unverschlüsselte Kennwort enthält.

Beispiele

Im folgenden Beispiel werden mehrere Eigenschaften der DeploymentBaseOptions -Klasse implementiert. In diesem Beispiel wird sowohl DeploymentBaseOptions für die Quell- als auch für das Zielobjekt instanziiert und die Eigenschaftswerte geändert, um einen Remotesynchronisierungsvorgang zu aktivieren.

using System;  
using Microsoft.Web.Deployment;  

namespace MSDeploy.Web.Deployment  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            // Example to show how DeploymentBaseOptions can be used  
            string _directory = Environment.ExpandEnvironmentVariables(  
                @"%systemdrive%\inetpub\wwwroot");  
            DeploymentSyncOptions syncOptions =   
                new DeploymentSyncOptions();  
            DeploymentBaseOptions sourceBaseOptions =   
                new DeploymentBaseOptions();  
            sourceBaseOptions.ComputerName = "sourceMachineName";  
            sourceBaseOptions.IncludeAcls = true; // false by default  
            sourceBaseOptions.UserName = "username";  
            sourceBaseOptions.Password = "password";  
            DeploymentBaseOptions destinationBaseOptions =   
                new DeploymentBaseOptions();  
            destinationBaseOptions.ComputerName =   
                "destinationMachineName";  
            destinationBaseOptions.UserName = "username";  
            destinationBaseOptions.Password = "password";  
            DeploymentObject deploymentObject =   
                DeploymentManager.CreateObject("contentPath",   
                _directory, sourceBaseOptions);  
            deploymentObject.SyncTo(  
                DeploymentWellKnownProvider.ContentPath, _directory,  
                destinationBaseOptions, syncOptions);  
        }  
    }  
}  

Gilt für: