Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从Sharepoint中仅按文件名获取文件_C#_.net_Sharepoint_Sharepoint 2010 - Fatal编程技术网

C# 如何从Sharepoint中仅按文件名获取文件

C# 如何从Sharepoint中仅按文件名获取文件,c#,.net,sharepoint,sharepoint-2010,C#,.net,Sharepoint,Sharepoint 2010,目前我得到的文件清单如下: private ClientContext _clientContext; var oList = _clientContext.Web.Lists.GetByTitle(SERVERURL); var oQuery = new CamlQuery(); var fileList = oList.GetItems(oQuery); _clientContext.Load(fileList); _clientContext.ExecuteQuery(); 它提

目前我得到的文件清单如下:

 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打开并读取的文件,该怎么办?我不想加载所有文件,然后循环浏览它们,而是想从SharePoint获取特定文件。

您可以使用您的
CamlQuery

oQuery.Query = 
@"<Where>
    <Eq>
        <FieldRef Name='Title'/><Value Type='Text'>DocTitle</Value>
    </Eq>
</Where>";
oQuery.Query=
@"
所有权
";
欲了解更多详情,请阅读