sharepoint 读取/_layouts/15/目录webconfig配置方法
来源:互联网 发布:江苏省困难职工数据库 编辑:程序博客网 时间:2024/06/05 09:42
本文顺便记录下,如何读取sharepoint的15目录下,webconfig配置文件属性值的方法。
// <summary>
///读取/_layouts/15/目录下,webconfig配置方法
///</summary>
public static stringGetConnectionString(stringConnectionName)
{
string path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
string CurrentPath = path + @"\CommonFiles\Microsoft Shared\web serverextensions\15\TEMPLATE\LAYOUTS\web.config";
XmlDocument doc = new XmlDocument();
doc.Load(CurrentPath);
XmlNode node = doc.SelectSingleNode("/configuration/connectionStrings/add[@name=\"" + ConnectionName + "\"]");
XmlElement element = (XmlElement)node;
string _connectionString = element.GetAttribute("connectionString");
return _connectionString;
}
// <summary>
///读取/_layouts/15/目录下,webconfig配置方法
///</summary>
public static string GetAppSettings(string AppSettingsKey)
{
string path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
string CurrentPath = path + @"\CommonFiles\Microsoft Shared\web serverextensions\15\TEMPLATE\LAYOUTS\web.config";
XmlDocument doc = new XmlDocument();
doc.Load(CurrentPath);
XmlNode node = doc.SelectSingleNode("/configuration/appSettings/add[@key=\"" + AppSettingsKey + "\"]");
XmlElement element = (XmlElement)node;
string _connectionString = element.GetAttribute("value");
return _connectionString;
}
- sharepoint 读取/_layouts/15/目录webconfig配置方法
- Webconfig配置和读取
- C# 读取WebConfig配置信息
- 读取webConfig的配置节点。
- SharePoint 2013中创建网站集时,页面URL会多出一段_layouts/15/start#
- SharePoint 2013 页面访问,Url中间多一段"_layouts/15/start.aspx#"
- 怎么读取webconfig和配置自定义节点?
- webconfig配置
- webconfig配置
- webconfig配置
- SharePoint _layouts下自定义程序页面权限管理
- C# 读取webconfig配置文件Appseting key值的方法
- Silverlight读取webconfig配置文件
- WebConfig 安全配置.....
- webconfig:配置邮件服务
- WebConfig配置简要说明
- webconfig 部分配置
- WebConfig配置详解
- Android获取屏幕大小
- php-fpm
- PAT B1037. 在霍格沃茨找零钱
- mybatis学习入门增删改查(一)
- UGUI相册实现
- sharepoint 读取/_layouts/15/目录webconfig配置方法
- JAVA可变形参方法
- Spring [boot] 使用技巧集合-不断积累
- 直方图处理(规定化)
- C#综合揭秘——细说事务
- CW3005|USB智能识别方案|赛微一级代理|中文规格书
- event loop js事件循环 microtask macrotask
- HDU 6033(Add More Zero) 简单数学题 Java
- 2017杭电多校联赛 1001 Add More Zero(取对数)HDU 6033