手机
当前位置:查字典教程网 >编程开发 >asp.net教程 >.NET 2.0获取配置文件AppSettings和ConnectionStrings节数据的方法
.NET 2.0获取配置文件AppSettings和ConnectionStrings节数据的方法
摘要:在.NETFramework2.0中,ConfigurationManager类新增了两个属性AppSettings和ConnectionS...

在.NETFramework2.0中,ConfigurationManager类新增了两个属性AppSettings和ConnectionStrings专门用来获取配置文件AppSettings和ConnectionStrings节的数据,使用方法如下:

复制代码 代码如下:

usingSystem.Configuration;

publicpartialclass_Default:System.Web.UI.Page

{

protectedvoidPage_Load(objectsender,EventArgse)

{

Label1.Text=ConfigurationManager.ConnectionStrings["connectionStringsName"].ToString();

Label2.Text=ConfigurationManager.AppSettings["appSettingsName"].ToString();

}

}

【.NET 2.0获取配置文件AppSettings和ConnectionStrings节数据的方法】相关文章:

asp.net为网页动态添加description描述信息的方法

asp.net中导出excel数据的方法汇总

SqlConnection.ConnectionString相关关键字

读取TXT文件内容的方法

.Net 如何限制用户登录的方法

System.Runtime.InteropServices.COMException的解决方法

ASP.NET 用户多次登录的解决方法

this connector is disabled错误的解决方法

ASP.NET 2.0下随机读取Access记录的实现方法

asp.net获取HTML表单File中的路径的方法

精品推荐
分类导航