Share via


CReplicationClient.DeleteFile Method

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

Deletes a file on each destination server that is defined for the Commerce Server Staging (CSS) project by using the replication settings that are defined for the CReplicationClient object.

Note

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

void DeleteFile(string file)

Parameters

  • file
    The file to delete. This string should include only the portion of the path that is relative to the project. It should not include the full path.

Remarks

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

If a connection to a destination server has already been already established, this method deletes the remote file. Otherwise, this method connects to the destination server, deletes the remote file, and then disconnects.

If transaction processing is turned on at the destination servers, the servers do not delete the file until either the Commit method or the Disconnect method is called.

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

Example

The following example deletes a file named oldfile.htm on the destination servers defined for the Project1 project.

CReplicationClient replicationClient = new CReplicationClient();
replicationClient.Initialize("Project1");
replicationClient.DeleteFile("oldfile.htm");

See Also

Other Resources

CReplicationClient.SendFile Method

CReplicationClient.GetExtendedErrorInfo Method

CReplicationClient Class