Condividi tramite


CReplicationProject.AddDestination Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Adds a destination to a Commerce Server Staging (CSS) project.

void AddDestination(string destination)

Parameters

  • destination
    The name of the destination to add to the project. A destination can be a server name, a route name, or a directory for same-box replications.

    At least one destination must be specified for a project to be staged.

    When you call this method from the server where you are logged in, you can also set the authentication credentials for the destination server by specifying "Destination;UserName;Password".

Remarks

Duplicate destination names are automatically eliminated from the list.

Note

If you add a destination that is on the same computer, you cannot replicate files by using a CReplicationClient object.

If you specify a route name, the Route flag must be set. By default, this flag is set. This causes CSS to look up the destination string in the routing table. If a route with a similar name exists, CSS will treat the destination as a route. Otherwise, it will treat the destination as a server or a directory. If the NoRoute flag is set, CSS will treat all strings as either server names or directories. For more information about these flags, see CSS API Flags.

The CReplicationProject.AddDestination method corresponds to the COM method named ReplicationProject.AddDestination.

Example

The following example adds the destination MyDest to the destinations that are defined for the project named MyProject.

CReplicationServer replicationServer = new CReplicationServer();
  replicationServer.Initialize("");

  CReplicationProject replicationProject = (CReplicationProject)replicationServer.OpenProject("MyProject", CSS_PROJECT_CREATION.OPEN_EXISTING_PROJECT);
  replicationProject.AddDestination("MyDest");

See Also

Other Resources

Projects

Routes

How to Create and Modify a Staging Project

How to Manage Routes

CReplicationProject.EnumDestination Method

CReplicationProject.RemoveDestination Method

CReplicationProject Class