簡體   English   中英

如何在SharePoint中獲取文件的元數據

[英]How to get the metadata of a file in SharePoint

我正在嘗試在SharePoint上獲取文件的名稱屬性?

如果嘗試獲取創建的列的元數據,則可以使用此方法獲取此數據

文件是SPFile。

if (file.GetProperty("DocId") != null)
{
    docId = file.GetProperty("DocId").ToString();
}

但是當我嘗試取名字時

if (file.GetProperty("Name") != null)
{
    docId = file.GetProperty("Name").ToString();
}
else {...}

轉到其他語句。

我哪里出錯了?

謝謝。

您最有可能希望查看文檔庫SPFile.GetListItem中與SPFile關聯的SPItem的屬性

您還可以使用SPFile.Properties枚舉文件的所有屬性,以查看“文件名”屬性的名稱類似於“ vti_title”。

我用完就可以了

file.Item.Name;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM