//Open site collection object
using (SPSite mySite = new SPSite("http://SiteUrl"))
{
// Open site
using (SPWeb oWeb= mySite .OpenWeb())
{
oWeb.ApplyTheme("<theme to be applied>");
oWeb.Update();
}
}
public void fnListAttachments(string site, string listName) { StringBuilder strAttachNames= new StringBuilder(); using (SPSite oSite = new SPSite(site)) { using (SPWeb oWeb = oSite.OpenWeb()) { SPList oList = oWeb.Lists[listName]; SPListItemCollection oListItems = oList.Items; foreach (SPListItem item in oListItems) { SPAttachmentCollection attachmentscol= item.Attachments; if (attachmentscol.Count <= 0) return string.Empty; foreach (var attachment in attachmentscol) { strAttachNames.Append(attachment.ToString()); } } } } //return strAttachNames.ToString(); }
A sales engineer is someone who promise you a bridge, even when there's no river.