내 프로젝트에 SharePoint 클라이언트 API를 사용해야하고 SharePoint에 업로드 된 폴더의 문서를 나열해야합니다. 내 폴더 링크 "https://mydomain.sharepoint.com/sites/blsmtekn/dyncrm/Shared%20Documents/Forms/AllItems.aspx"SharePoint 웹 사이트에서 문서 라이브러리 가져 오기
using (ClientContext ctx = new ClientContext("https://mydomain.sharepoint.com/"))
{
string userName = "username";
string password = "password";
SecureString secureString = new SecureString();
password.ToList().ForEach(secureString.AppendChar);
ctx.Credentials = new SharePointOnlineCredentials(userName, secureString);
List list = ctx.Web.Lists.GetByTitle("/Shared Documents/");
CamlQuery caml = new CamlQuery();
caml.ViewXml = @"<View Scope='Recursive'>
<Query>
</Query>
</View>";
caml.FolderServerRelativeUrl = "/sites/blsmtekn/dyncrm/";
ListItemCollection listItems = list.GetItems(caml);
ctx.Load(listItems);
ctx.ExecuteQuery();
}
받고있다 그러나 나는 "URL과 함께 사이트에 존재하지 않는 ... 목록"와 같은 오류를 얻고있다. 해당 폴더 아래에있는 폴더 및 파일 목록을 재귀 적으로 가져 오는 방법은 무엇입니까?
감사하지만 난 변경 후 같은 오류가 받고 있어요 :
모든 모든 코드에서 다음과 같이한다. –
그럼 당신의 URL은 여전히 잘못입니다. – Marco
Web.Lists 메서드를 사용하여 내 Lists를 검사 한 결과 내 파일이 "Belgeler"목록 아래에 있음을 확인했습니다. 셰어 포인트 API와 폴더 구조를 이해하는 데 어려움이 있습니다. –