草庐IT

mysqlconn

全部标签

C# 从 appSetting 获取一行?

有没有更简单的方法来完成下面的几行?vardoc=newXmlDocument();doc.Load("../../../MyWebSite/Web.config");varmysqlconn=doc.DocumentElement.SelectSingleNode("//appSettings//add[@key='mysqlconn']").Attributes["value"].Value; 最佳答案 System.Configuration.ConfigurationManager.AppSettings["mysqlcon