Project Online에서 작업하십시오

ProjectserverManager 클래스는 지정된 프로젝트 온라인 계정에서 프로젝트를 검색하는 방법을 제공합니다. ProjectserverCredentials 클래스는 Project Online에 연결하는 데 사용되는 자격 증명을 제공하는 데 사용됩니다. 이전에는 Microsoft.sharePoint.client.runtime 어셈블리가 AuthToken을 검색하는 데 사용되었지만 이제 Aspose.Tasks 는 온라인 프로젝트에 연결하기 위해 SiteURL, 사용자 이름 및 비밀번호를 지정하는 옵션을 제공합니다.

프로젝트 온라인 프로젝트 읽기

다음 줄의 코드는 온라인으로 프로젝트를 읽는 방법을 보여줍니다.

 1System::String sharepointDomainAddress = u"https://contoso.sharepoint.com";
 2System::String userName = u"admin@contoso.onmicrosoft.com";
 3System::String password = u"MyPassword";
 4
 5System::SharedPtr<ProjectServerCredentials> credentials = System::MakeObject<ProjectServerCredentials>(sharepointDomainAddress, userName, password);
 6
 7System::SharedPtr<ProjectServerManager> manager = System::MakeObject<ProjectServerManager>(credentials);
 8System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<ProjectInfo>>> list = manager->GetProjectList();
 9
10for (const auto& p : System::IterateOver(list))
11{
12    System::Console::WriteLine(u"Name : " + p->get_Name());
13    System::Console::WriteLine(u"CreatedDate : " + p->get_CreatedDate().ToString());
14    System::Console::WriteLine(u"Name : " + p->get_LastSavedDate().ToString());
15                            
16}

Create a Project Online

The following lines of code demonstrate how to create a project online.

 1System::String sharepointDomainAddress = u"https://contoso.sharepoint.com";
 2System::String userName = u"admin@contoso.onmicrosoft.com";
 3System::String password = u"MyPassword";
 4
 5System::SharedPtr<ProjectServerCredentials> credentials = System::MakeObject<ProjectServerCredentials>(sharepointDomainAddress, userName, password);
 6
 7System::SharedPtr<Project> project = System::MakeObject<Project>(u"sample.mpp");
 8
 9System::SharedPtr<ProjectServerManager> manager = System::MakeObject<ProjectServerManager>(credentials);
10manager->CreateNewProject(project);
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.