我想修改app.config中appSetting部分的值.所以我写道,
Console.WriteLine(ConfigurationManager.AppSettings["name"]);
Console.Read();
Configuration config=ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.AppSettings.Settings["name"].Value = "raja";
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings");
Console.WriteLine(ConfigurationManager.AppSettings["name"]);
Console.Read();
Run Code Online (Sandbox Code Playgroud)
执行上面的代码后,我验证了app.config是否更改了"name"元素的值.但没有变化.
我的代码出了什么问题?或者还有其他方法吗?
将int转换为char的最快方法是什么?我需要更快的方式因为,
convertingchar = Convert.ToChar(intvalue);
Run Code Online (Sandbox Code Playgroud)
是我在该计划中最慢的部分.我有多个不同的int值,必须转换为char.我的项目很大,我无法发布我的功能.这就是我发布这个测试功能的原因.
我的代码到目前为止.
char convertingchar = ' ';
...some code...
public void convert(int intvalue){
convertingchar = Convert.ToChar(intvalue);
}
Run Code Online (Sandbox Code Playgroud) 我知道有lightweight组件和heavyweight在组件AWT和SWING.但是那些在C#.NET中的对应物是什么WinForms?