Microsoft Project Online部署方案
发布人:shili8
发布时间:2023-06-19 09:51
阅读次数:34
Microsoft Project Online是一款基于云端的项目管理软件,它可以帮助企业实现项目计划、资源分配、任务跟踪等功能。本文将介绍如何部署Microsoft Project Online,并提供部分代码示例和代码注释。
一、环境准备
在部署Microsoft Project Online之前,需要先准备好以下环境:
1. Office 365订阅账号
2. SharePoint Online订阅账号
3. Project Online订阅账号
4. Visual Studio 2015或更高版本
5. Microsoft Project Online SDK
二、创建Project Online应用程序
1. 在Azure门户中创建一个新的应用程序
2. 在应用程序中添加Project Online API权限
3. 在Visual Studio中创建一个新的ASP.NET Web应用程序
4. 在Web应用程序中添加Microsoft.ProjectServer.Client和Microsoft.SharePoint.Client引用
5. 在Web应用程序中添加以下代码:
csharp using Microsoft.ProjectServer.Client; using Microsoft.SharePoint.Client; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace ProjectOnlineWebApp { public partial class Default : System.Web.UI.Page { protected void Page_Load(object sender EventArgs e) { // Connect to Project Online string siteUrl = /> string userName = <username>@<tenant>.onmicrosoft.com; string password = <password>; var securePassword = new System.Security.SecureString(); foreach (char c in password) { securePassword.AppendChar(c); } var onlineCredentials = new SharePointOnlineCredentials(userName securePassword); var context = new ProjectContext(siteUrl); context.Credentials = onlineCredentials; context.Load(context.Projects); context.ExecuteQuery(); // Display project names foreach (var project in context.Projects) { Response.Write(project.Name + <br/>); } } } }
代码注释:
1. 使用Microsoft.ProjectServer.Client和Microsoft.SharePoint.Client命名空间
2. 创建一个ASP.NET Web应用程序
3. 连接到Project Online
4. 显示项目名称
三、部署Project Online应用程序
1. 在Visual Studio中发布Web应用程序
2. 将Web应用程序部署到Azure门户
3. 在Azure门户中配置应用程序设置
4. 在Azure门户中启动应用程序
四、总结
本文介绍了如何部署Microsoft Project Online,并提供了部分代码示例和代码注释。通过本文的学习,读者可以了解到如何连接到Project Online、获取项目信息等操作。希望本文能够对读者有所帮助。