Ana içeriğe atla


Property Bag etiketine sahip yayınlar gösteriliyor

Getting Values from SharePoint 2013 Property Bags

SharePoint 2013 has a hierarchical set of property bags. At each of the following levels in a SharePoint farm, one can store properties and their corresponding values: Farm Web Application Site Web List This can be extremely handy when writing code. For example, if you have four different environments (Development, QA, Staging, Production), you could store properties in each environment's farm property bag that specifies things like connection strings, debugging constants, or host URLs. It's even handier when you have a simple means to extract these properties from the property bag in your code. I generally make a class (FarmProperty in the example below) with a "Get" method that extracts the string value for the given property. public class FarmProperty { public static string Get(string name) { string value = null; SPSecurity.RunWithElevatedPrivileges(() => { var farm = SPFarm.Local;