CReplicationRoute.Get Method

Gets the value of a property for a Commerce Server Staging (CSS) route.

Note

Routes can be used only to stage Web content and business data.

object Get(string propName)

Parameters

  • propName
    The name of the property to get. The only property available is BaseDirectory. This identifies the directory from which the content is replicated.

Return Value

The value of the requested property. For the BaseDirectory property, which is the only property currently available, the return value is a string that contains the directory from which the content is replicated.

Remarks

The CReplicationRoute.Get method corresponds to the COM method named ReplicationRoute.Get.

Example

The following example retrieves and displays the value of the BaseDirectory property for all routes.

CReplicationServer replicationServer = new CReplicationServer();
replicationServer.Initialize("");
CReplicationRoute replicationRoute;
int i = 0;
object iterator = i as object;
while (true)
  {
  try
    {
    replicationRoute = replicationServer.EnumRoutes(ref iterator) as CReplicationRoute;
    Console.WriteLine("The base directory for route {0} is {1}", replicationRoute.get_Name(), replicationRoute.get_BaseDirectory());
    }
    catch (System.Runtime.InteropServices.COMException e)
    {
       // Quit if "No more items" or "No routes" error
       if (e.ErrorCode == -2147422485 || e.ErrorCode == -1073680678)
         break;
      else
         throw;
    }
  }

See Also

Other Resources

CReplicationRoute.BaseDirectory Property

CReplicationRoute.Put Method

CReplicationRoute Class