当前位置:Gxlcms > 数据库问题 > 从配置文件中取出数据库链接字符串的技巧

从配置文件中取出数据库链接字符串的技巧

时间:2021-07-01 10:21:17 帮助过:2人阅读

Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

而在一些web项目中,可以尝试使用以面代码来取出配置文件中的信息

1 Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(System.Web.HttpContext.Current.Request.ApplicationPath);

 

从配置文件中取出数据库链接字符串的技巧

标签:

人气教程排行