sharepoint オブジェクト モデルを使用してプログラムで documentSet をダウンロードする方法のコード スニペットは本当に役に立ちます。
私がやろうとしていることは、-共有ポイントサイトを指定して、ユーザーのデフォルトの資格情報でログインします-ファイルがホストされているドキュメントライブラリを探します-ファイルをローカルマシンにプルダウンします
今までやってきたこと、
using Microsoft.SharePoint.Client;
ClientContext cc = new ClientContext(ConfigurationManager.AppSettings["site"]);
cc.Credentials = new NetworkCredential(username, pwd, domain);
Web site = cc.Web;
ListCollection collList = site.Lists;
var oList = collList.GetByTitle("Document Set test");
// Get the document set
cc.Load(oList);
cc.ExecuteQuery();
// Get All views
var views = oList.Views;
cc.Load(views);
cc.ExecuteQuery();
// Get All documents
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = @"<Query>
<ViewFields>
<FieldRef Name='Title'/>
<FieldRef Name='Display Name'/>
</ViewFields>
<Where>
<Gt>
<FieldRef Name='Created' />
<Value IncludeTimeValue='TRUE' Type='DateTime'>1900-05-08T14:25:50Z</Value>
</Gt>
</Where>
<OrderBy>
<FieldRef Name='Title' Ascending='True' />
</OrderBy>
</Query>";
var docs = oList.GetItems(camlQuery);
cc.Load(docs);
cc.ExecuteQuery();
Console.WriteLine(string.Format("{0} Models in the repository", docs.Count));
foreach (var doc in docs) {
// ドキュメント セット内のドキュメントをダウンロードします - しかし、どのように?
Console.WriteLine(string.Format("{0} => {1} ", Environment.NewLine, doc["Title"]));
}
Console.WriteLine(Environment.NewLine);