且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何读取配置文件,以便结果存储在不同的字符串对象中?

更新时间:2023-11-13 16:21:58

我想知道代码项目在该论证上有一篇或两篇文章...... [ ^ ]。


这不是最优雅的解决方案,但是......



This isn't the most elegant solution, but...

SettingsPropertyCollection props = Properties.Settings.Default.Properties;

string[] array = new string[props.Count];

int i = 0;
foreach (SettingsProperty prop in props)
{
    array[i++] = prop.DefaultValue.ToString();
}







: - )




:-)