Jaa


CReplicationClientError.FileName Property

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

Gets or sets the name of the file associated with the Commerce Server Staging (CSS) error.

object FileName { set; get; }

Return Value

A string that contains the name of the file.

Remarks

You must have CSS administrator rights to get or set this property.

The CReplicationClientError.FileName property corresponds to the COM property named ReplicationClientError.FileName.

Example

The following example tries to delete a file. If errors occur, it displays the file name and the error code associated with each error.

CReplicationClient replicationClient = new CReplicationClient();
replicationClient.Initialize("Project1");
try
{
    replicationClient.DeleteFile(@"myfile.htm");
}
catch (System.Runtime.InteropServices.COMException)
{
    object[] errors = (object[])replicationClient.GetExtendedErrorInfo();
    // If the ClientError array is not empty, loop through it and display each error
    int numElements = errors.Length;
    if (numElements > 0)
    {
        for (int i = 0; i < numElements; i++)
        {
            Console.WriteLine("File: {0}", ((CReplicationClientError)errors[i]).get_FileName());
            Console.WriteLine("Error: {0}", ((CReplicationClientError)errors[i]).get_ErrorCode());
        }
    }
}

See Also

Other Resources

CReplicationClient.GetExtendedErrorInfo Method

CReplicationClientError Class