Share via


CReplicationProject.StartReplicationClient Method

Returns a CReplicationClient object that can be used to replicate individual files for Commerce Server Staging (CSS) projects.

Note

The CReplicationClient object can be used only to replicate files that are associated with a Web content staging project. It cannot be used to replicate Internet Information Services (IIS) metabase projects or business data projects.

object StartReplicationClient(int reserved)

Parameters

  • reserved
    This property is reserved for future use and should be set to 0 (zero).

Return Value

A CReplicationClient object.

Remarks

You must create a Web content project before you call the StartReplicationClient method. If you have not defined a project before you call this method, the method will fail and set the error code to -1073680687 ("Could not find the project.").

If the project is already running, the StartReplicationClient method will fail and set the error code to -1073680665 ("Project is already running.").

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

Example

The following example starts a replication client on a new project named Latest. It sets the destination to Mydest, the local directory to C:\LocalCopy, and specifies that all directories should be excluded (flags=4096). The example then sends two files named NewFile.html and OldFile.html.

CReplicationServer replicationServer = new CReplicationServer();
  replicationServer.Initialize("");
  CReplicationProject replicationProject;
  replicationProject = (CReplicationProject)replicationServer.OpenProject("Latest", CSS_PROJECT_CREATION.CREATE_NEW_PROJECT);
  replicationProject.Put("Destination", @"Mydest");
  replicationProject.Put ("LocalDirectory", (@"C:\LocalCopy");
  replicationProject.Put ("Flags", "4096");
  replicationProject.Commit();
  CReplicationClient replicationClient;
  replicationClient = (CReplicationClient)replicationProject.StartReplicationClient(0);
  replicationClient.SendFile("NewFile.html");
  replicationClient.SendFile("OldFile.html");

See Also

Other Resources

Projects

How to Replicate Individual Files

Individual File Replications

CReplicationProject.Put Method

CReplicationClient.Initialize Method

CReplicationClient Class

CReplicationProject Class