SPFolder.Properties 属性

获取哈希表,包含元数据的文件夹。

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public ReadOnly Property Properties As Hashtable
    Get
用法
Dim instance As SPFolder
Dim value As Hashtable

value = instance.Properties
public Hashtable Properties { get; }

属性值

类型:System.Collections.Hashtable
System.Collections.Hashtable对象,该对象包含的元数据。

备注

备注

在此属性中存储的大量数据将会严重降低性能。不要将超过 1 千字节 (1 k) 的用户数据存储在此属性中。

示例

下面的代码示例循环访问当前 Web 站点中的文件夹的集合,并显示的属性和值的每个文件夹。

此示例要求using指令 (在 Visual Basic 中的Imports ) 的Microsoft.SharePointMicrosoft.SharePoint.Utilities的命名空间。

SPWeb oWebsite = SPContext.Current.Web;
SPFolderCollection collFolders = oWebsite.Folders;

foreach (SPFolder oFolder in collFolders)
{
   System.Collections.Hashtable oHashtable = oFolder.Properties;
   System.Collections.ICollection collKeys = oHashtable.Keys;

      foreach (object oKey in collKeys)
      {
         Response.Write(SPEncode.HtmlEncode(oKey.ToString()) + " :: " + 
             SPEncode.HtmlEncode(hashtable[oKey.ToString()]) + "<BR>");
      }
}
Dim oWebsite As SPWeb = SPContext.Current.Web
Dim collFolders As SPFolderCollection = oWebsite.Folders

For Each oFolder As SPFolder In collFolders
   Dim oHashtable As System.Collections.Hashtable = oFolder.Properties
   Dim collKeys As System.Collections.ICollection = oHashtable.Keys

     For Each oKey As Object In collKeys
       Response.Write(SPEncode.HtmlEncode(oKey.ToString()) & " :: " & SPEncode.HtmlEncode(hashtable(oKey.ToString())) & "<BR>")
     Next oKey
Next oFolder

前面的示例中显示的元数据,如下所示:

vti_dirlateststamp :: 8/30/2006 1:06:19 AM
vti_etag :: "{101141FF-9E99-4404-AE4D-561B981472E4},0"
vti_isexecutable :: false
vti_candeleteversion :: true
vti_docstoretype :: 1
vti_timecreated :: 8/21/2006 1:28:31 AM
vti_isbrowsable :: true
vti_hassubdirs :: true
vti_listname :: {B6C3C6F9-A256-4FA4-B6A2-97549D48E530}
vti_replid :: rid:{101141FF-9E99-4404-AE4D-561B981472E4}
vti_listenableversioning :: false
vti_listenableminorversions :: false
vti_listbasetype :: 1
vti_level :: 1
vti_rtag :: rt:101141FF-9E99-4404-AE4D-561B981472E4@00000000000
vti_timelastmodified :: 8/21/2006 1:28:41 AM
vti_listservertemplate :: 101
vti_listrequirecheckout :: false
vti_listenablemoderation :: false
vti_listtitle :: TestDocLib2
vti_isscriptable :: false

另请参阅

引用

SPFolder 类

SPFolder 成员

Microsoft.SharePoint 命名空间