我试图调用Microsoft.SharePoint.Client.Sharing.SecurableObjectExtensions.GetSharingInformation()方法,该方法存在于微软的文档中,在以下链接中:https://learn.microsoft.com/en-us/openspecs/sharepoint_protocols/ms-csomspt/3b13bf76-d6ca-4918-b500-7585fecdf79b。
我安装了一些sharepoint包,但是在命名空间SecurableObjectExtensions中找不到类Microsoft.SharePoint.Client.Sharing。有人能帮我解决这个问题吗?
这是我的实际代码:
using System;
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.Sharing;
namespace Borrar
{
class Program
{
static void Main(string[] args)
{
ClientContext context = new ClientContext("https://<tenant>.sharepoint.com/sites/<site>")
{
Credentials = new SharePointOnlineCredentials("user@domain", securePassword),
};
context.Load(context.Web, w => w.Title);
context.ExecuteQuery();
List docList = context.Web.Lists.GetByTitle("Documents");
context.Load(docList);
// This creates a CamlQuery that has a RowLimit of 100, and also specifies Scope="RecursiveAll"
// so that it grabs all list items, regardless of the folder they are in.
CamlQuery query = CamlQuery.CreateAllItemsQuery(100);
ListItemCollection items = docList.GetItems(query);
// Retrieve all items in the ListItemCollection from List.GetItems(Query).
context.Load(items);
context.ExecuteQuery();
foreach (ListItem listItem in items)
{
//The problem is here
var sharingInfo = Microsoft.SharePoint.Client.Sharing.SecurableObjectExtensions.GetSharingInformation(listItem);
Console.WriteLine(sharingInfo);
}
}
}
}发布于 2020-05-14 02:16:39
这应该是REST
https://cann0nf0dder.wordpress.com/2018/04/04/externally-sharing-getsharinginformation-rest-api/
如前所述,“协议服务器端点是通过将"_vti_bin/client.svc/ProcessQuery”附加到站点(2)的URL中形成的,
https://stackoverflow.com/questions/61784933
复制相似问题