[英]How to get the Files by only File Name from Sharepoint
目前,我得到的文件清單如下:
private ClientContext _clientContext;
var oList = _clientContext.Web.Lists.GetByTitle(SERVERURL);
var oQuery = new CamlQuery();
var fileList = oList.GetItems(oQuery);
_clientContext.Load(fileList);
_clientContext.ExecuteQuery();
它為我提供了服務器上的所有文件。
但是,如果我知道要從SharePoint和Read打開的文件怎么辦? 我不想加載所有文件,然后遍歷它們,而是想從SharePoint獲取該特定文件。
您可以使用您的CamlQuery
:
oQuery.Query =
@"<Where>
<Eq>
<FieldRef Name='Title'/><Value Type='Text'>DocTitle</Value>
</Eq>
</Where>";
有關更多詳細信息,請參閱查詢架構 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.