2017-04-21 54 views

回答

1

使用.NET客户端对象模型,如Microsoft here所述,您可以编写C#或VB.Net代码来访问SharePoint。

微软提供了a walkthrough,向您展示了如何将所需的程序集添加到项目中。

下面是相关的摘录:

在你的项目中,添加引用了组成.NET客户端对象模型的两个必需的组件。这两个组件(Microsoft.SharePoint.Client.dll和Microsoft.SharePoint.Client.Runtime.dll)位于%ProgramFiles%\ Common Files \ Microsoft Shared \ web server extensions \ 14的ISAPI文件夹中。

加载程序集后,您可以使用SharePoint客户端对象模型对象检索信息,如文档here所述。例如:

如何检索对象

下面的示例演示如何加载对象来访问它的属性。由于列表对象已就位加载,因此可以访问列表的所有默认属性。

Dim clientContext As New ClientContext("http://MyServer/sites/MySiteCollection") 
Dim oWebsite As Web = clientContext.Web 
Dim collList As ListCollection = oWebsite.Lists 

Dim oList As List = collList.GetByTitle("Announcements") 

clientContext.Load(oList) 

clientContext.ExecuteQuery() 

Console.WriteLine("Title: {0} Created: {1}", oList.Title, oList.Created) 

参考链接用于更深入的文档的上方。

相关问题