私のプロジェクトにはsharepointクライアントapiを使用し、sharepointにアップロードされたフォルダにはドキュメントをリストする必要があります。マイフォルダは、リンク「https://mydomain.sharepoint.com/sites/blsmtekn/dyncrm/Shared%20Documents/Forms/AllItems.aspx」SharePoint WebSiteでドキュメントライブラリを入手
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
私はListをWeb.Listsメソッドでチェックしました。ファイルが "Belgeler"リストの下にあることがわかりました。私はsharepoint apiとフォルダ構造を理解するのが難しいです。 –