Tuesday, 29 April 2008

How to Identify the SPFile.Properties hash table collection

using Microsoft.Sharepoint;
using System.Collections;


SPSite _site = new SPSite("http://servername");
SPFile _file = _site.OpenWeb().Folders("/Pages").File[1];
Hashtable ht = _file.Properties;
StringBuilder sb = new StringBuilder();
sb.AppendLine("**The Properties of " + _file.Name.ToString()+" are as follows**");
foreach(DictionaryEntry de in ht)
{
sb.Appendline("The key is " + de.Key.ToString() + " ; Value is " + de.Value.ToString() );

}

MessageBox.Show(sb.ToString());

To Identify whether page is ghosted or not use SPFile.CustomizedPageStatus.

No comments: