我有两个NameValueCollections:
NameValueCollection customTag = (NameValueCollection)System.Configuration.ConfigurationManager.GetSection("secureAppSettings");
NameValueCollection appSetting = (NameValueCollection)System.Configuration.ConfigurationManager.GetSection("appSettings");
Run Code Online (Sandbox Code Playgroud)
我尝试了customTag.Add(appSetting);方法,但是我收到了这个错误:Collection is read-only.
我如何将它们组合成一个,所以我可以访问两者中的所有元素?
我写了一个名为的类ConfigurationManager.cs,它可以改变原来的内置(内置)ConfigurationManager.
访问我的班级:
ConfigruationManager.AppSettings["key"];
Run Code Online (Sandbox Code Playgroud)
要访问系统类:
System.Configuration.ConfigurationManager.AppSettings["key"];
Run Code Online (Sandbox Code Playgroud)
我想要做的是,如果有人使用系统类,它仍然应该访问我班级中的那个.
我有一个o包含字符串的列表:
"Hist 2368#19:00:00#20:30:00#Large Conference Room",
"Hist 2368#09:00:00#10:30:00#Large Conference Room",
Run Code Online (Sandbox Code Playgroud)
我想将这些字符串添加到此:
var lines = new[]
{
"Meeting#19:00:00#20:30:00#Conference",
};
Run Code Online (Sandbox Code Playgroud)
我如何使用列表中的数据o并将其插入lines?