DeploymentBaseOptions 建構函式

定義

多載

DeploymentBaseOptions()

建立 DeploymentBaseOptions 物件的執行個體。

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

範例

下列範例會實作 類別的 DeploymentBaseOptions 數個屬性。 這個範例會同時具現化 DeploymentBaseOptions 來源和目的地物件的 ,並修改屬性值以啟用遠端同步作業。

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);  
        }  
    }  
}  

適用於

DeploymentBaseOptions(SerializationInfo, StreamingContext)

protected:
 DeploymentBaseOptions(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected DeploymentBaseOptions (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new Microsoft.Web.Deployment.DeploymentBaseOptions : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> Microsoft.Web.Deployment.DeploymentBaseOptions
Protected Sub New (info As SerializationInfo, context As StreamingContext)

參數

適用於