mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 17:02:10 -10:00
* added: ConfigurationRemoveElement.cs, common element for <remove> * ConnectionStringSettingsCollection.cs: reverted last fix for <remove> element * ConfigurationElementCollection.cs: fixed the way that OnDeserializeUnrecognizedElement method handles <remove> element * t37.cs, t37.exe.config, t37.exe.expected: added some tests for <remove> element svn path=/trunk/mcs/; revision=67370
34 lines
1.3 KiB
C#
34 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Specialized;
|
|
using System.Configuration;
|
|
using System.Xml;
|
|
|
|
class T1
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
try {
|
|
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration (ConfigurationUserLevel.None);
|
|
|
|
ConfigurationSection connStrings = config.ConnectionStrings;
|
|
|
|
ConnectionStringSettings cssc = ((ConnectionStringsSection)connStrings).ConnectionStrings["LocalSqlServer"];
|
|
Console.WriteLine ("connStrings[LocalSqlServer] = {0}", (cssc == null ? "null" : cssc.ConnectionString));
|
|
|
|
ConnectionStringSettings cssc2 = ((ConnectionStringsSection)connStrings).ConnectionStrings["AccessFileName"];
|
|
Console.WriteLine ("connStrings[AccessFileName] = {0}", (cssc2 == null ? "null" : cssc2.ConnectionString));
|
|
|
|
AppSettingsSection sect = (AppSettingsSection) config.AppSettings;
|
|
Console.WriteLine ("sect.Settings[hithere] = {0}", (sect.Settings ["hithere"] == null ? "null" : sect.Settings ["hithere"].Value.ToString ()));
|
|
|
|
RsaProtectedConfigurationProvider rsa = (RsaProtectedConfigurationProvider)ProtectedConfiguration.Providers [ProtectedConfiguration.DefaultProvider];
|
|
Console.WriteLine ("rsa = {0}", (rsa == null ? "null" : rsa.ToString ()));
|
|
|
|
}
|
|
catch (Exception e) {
|
|
Console.WriteLine ("{0} raised", e.GetType());
|
|
Console.WriteLine (e.Message);
|
|
}
|
|
}
|
|
}
|