首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到Microsoft.SharePoint.Client.Sharing.SecurableObjectExtensions.GetSharingInformation()方法

找不到Microsoft.SharePoint.Client.Sharing.SecurableObjectExtensions.GetSharingInformation()方法
EN

Stack Overflow用户
提问于 2020-05-13 21:12:13
回答 1查看 240关注 0票数 0

我试图调用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。有人能帮我解决这个问题吗?

这是我的实际代码:

代码语言:javascript
复制
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);
            }
        }
    }
}
EN

回答 1

Stack Overflow用户

发布于 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://learn.microsoft.com/en-us/openspecs/sharepoint_protocols/ms-csomspt/1eb5bf91-ac5b-4fed-b75f-9d9d19a501e8

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61784933

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档