다음을 통해 공유


CReplicationClient.Connect Method

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

Initiates connections to each destination server that is defined for the Commerce Server Staging (CSS) project.

Note

This method and the CReplicationClient object are used only to stage individual files. You cannot use this method to stage projects.

void Connect()

Remarks

You must have CSS administrator or operator rights on the project to call this method.

If you use the SendFile, SendFiles, and DeleteFile methods without the Connect and Disconnect methods, the SendFile, SendFiles, and DeleteFile methods each perform their own connect and disconnect operations. By using the Connect and Disconnect methods, you can avoid this overhead, which can be significant when you update several files.

The CReplicationClient.Connect method corresponds to the COM method named ReplicationClient.Connect.

Example

The following example initiates server connections for a project named Project1, sends a file, and then disconnects.

CReplicationClient replicationClient = new CReplicationClient();
replicationClient.Initialize("Project1");

replicationClient.Connect();
replicationClient.SendFile("newfile.htm");
// ...
replicationClient.Disconnect();

See Also

Other Resources

CReplicationClient.Disconnect Method

CReplicationClient Class