SharePoint Foundation 2010 中支持客户端对象模型,通过ClientObjectModel,可以很容易的访问服务器上的SharePoint数据,这样SharePoint 2010的开发就可以在32位机器进行了,我们还可以通过Client Object Model开发SharePoint的客户端,实现旁客户端,下面是Client Object Model和Server Object Model 的对照图: Client-side classes and server-side equivalents
SPWeb oWebsite = SPContext.Current.Web; using (SPWeb oWebsiteRoot = SPContext.Current.Site.RootWeb) using(SPWeb oWebsite = SPContext.Current.Site.OpenWeb("Website_URL")) using(SPSite oSiteCollection = new SPSite("http://Server_Name")) SPList oListCur = SPContext.Current.List; using(SPWeb oWeb = SPContext.Current.Site.OpenWeb(guidWebsite)) SPSiteDataQuery oSiteQuery = new SPSiteDataQuery(); using (SPSite site = new SPSite("http://localhost")) A User field contains a string in the form ID;#User_Display_Name, where ID is the member identifier (ID) of the associated user. The following example parses the value of an Assigned To field to return an SPUser object. string strUserValue = oList["Assigned To"]; |
SharePoint 2010中开发模式的改进 COM 客户端对象模型
摘要: SharePoint Foundation 2010 中支持客户端对象模型,通过ClientObjectModel,可以很容易的访问服务器上的SharePoint数据,这样SharePoint 2010的开发就可以在32位机器进行了,我们还可以通过Client Object Model开发 ...