.NET读取配置文件 App.config

2019-04-15 15:46发布

[img]http://dl.iteye.com/upload/picture/pic/116775/e2dc76e5-8e61-3a8a-9528-c6453d7fff7c.png[/img]

Configuration config =ConfigurationManager.OpenExeConfiguration("");
AppSettingsSection settings = (AppSettingsSection)config.GetSection("appSettings");
label1.Text = settings.Settings["iMessage"].Value;







[img]http://dl.iteye.com/upload/picture/pic/116777/3364bf89-2428-3cf2-a9d4-8586147c96fe.png[/img]