다음을 통해 공유


CReplicationServer.OpenProject Method

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

Opens an existing Commerce Server Staging (CSS) project or creates a new project.

object OpenProject(string project, Microsoft.CommerceServer.Staging.Interop.CSS_PROJECT_CREATION projectFlag)

Parameters

  • project
    The name of the project to open or create. Project names must consist of alphanumeric characters and must not exceed 49 characters.

  • projectFlag
    A value that specifies whether to open an existing project or create a new project. The following table shows the valid values for the projectFlag parameter.

    Project flag

    Value

    Description

    CREATE_NEW_PROJECT

    1

    Creates a new project

    OPEN_EXISTING_PROJECT

    2

    Opens an existing project.

Return Value

The CReplicationProject object that represents a new or existing CSS project.

Remarks

You must have CSS administrator or operator permissions to call this method.

Note

When you set the projectFlag parameter to CREATE_NEW_PROJECT, CSS sets the Name property on the CReplicationProject object to the value that you specify for the project parameter.

The COM CReplicationServer.OpenProject method corresponds to the COM method named ReplicationServer.OpenProject.

Example

The following example opens an existing project named Project2.

CReplicationServer replicationServer = new CReplicationServer();
  replicationServer.Initialize("");
  CReplicationProject replicationProject = (CReplicationProject)replicationServer.OpenProject("Project2", CSS_PROJECT_CREATION.OPEN_EXISTING_PROJECT);

See Also

Other Resources

Projects

How to Create and Modify a Staging Project

CReplicationServer Class