次の方法で共有


CReplicationClientError.Source Property

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

Gets or sets the name of the source staging server where the Commerce Server Staging (CSS) error occurred.

object Source { set; get; }

Return Value

A string that contains the name of the source server.

Remarks

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

The source server is the computer where the CReplicationClient object was created.

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

Example

The following example tries to delete a file. If any errors occur, it displays the name of the source computer on which the client was created and the associated error codes.

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("Source: {0}", ((CReplicationClientError)errors[i]).get_Source());
            Console.WriteLine("Error: {0}", ((CReplicationClientError)errors[i]).get_ErrorCode());
        }
    }
}

See Also

Other Resources

CReplicationClient.GetExtendedErrorInfo Method

CReplicationClientError Class