Tag: csom

使用CSOM读取Sharepoint中的网站页面内容

在我的项目中,我需要在本地存储网站页面。 这些页面可能是已发布或未发布的页面。 我尝试使用以下代码但无法获取页面内容。 ClientContext clientcontext = new ClientContext(url); var credentials = new SharePointOnlineCredentials(userid, SecurePass); clientcontext.Credentials = credentials; Web web = clientcontext.Web; clientcontext.Load(web, website => website.Lists); clientcontext.ExecuteQuery(); clientcontext.Load(web, website => website.Lists, website => website.Lists.Where( x => x.BaseTemplate == 119)); clientcontext.ExecuteQuery(); var _collection = web.Lists; foreach (var pages in _collection) { clientcontext.Load(pages); clientcontext.ExecuteQuery(); CamlQuery cq = new […]

将SharePoint文件夹和内容移动到同一文档库中的不同位置

我正在寻找一种方法,使用SharePoint 2010客户端对象模型(C#)将文件夹及其所有内容移动到同一库中的其他位置。 例如,我们有一个项目的文件夹(比如12345),它的URL是 http://sharepoint/site/library/2012/12345 2012年代表一年。 我想以编程方式将12345文件夹移动到另一年,比如2014年可能已存在但可能不存在。 我一直在搜索,但我得到的解决方案似乎非常复杂,并且与将文件夹移动到不同的网站集有关,我希望因为它在同一个库中可能有一个更简单的解决方案? 我的一个想法是依靠Explorer View而不是CSOM? 非常感谢!

身份validation在调试时成功但在Azure App Service上失败

我只是使用CSOM使用以下方法从SharePoint获取一些用户。 这一直对我有用,我没有任何问题。 突然间,当我今天尝试调用此方法时,它会因此错误而失败 The sign-in name or password does not match one in the Microsoft account system. at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String securityXml, String serviceTarget, String servicePolicy) at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String username, String password, String serviceTarget, String servicePolicy) at Microsoft.SharePoint.Client.Idcrl.SharePointOnlineAuthenticationProvider.GetAuthenticationCookie(Uri url, String username, SecureString password, Boolean alwaysThrowOnFailure, EventHandler`1 executingWebRequest) at Microsoft.SharePoint.Client.SharePointOnlineCredentials.GetAuthenticationCookie(Uri url, Boolean refresh, Boolean alwaysThrowOnFailure) at Microsoft.SharePoint.Client.ClientRuntimeContext.SetupRequestCredential(ClientRuntimeContext context, HttpWebRequest […]