如何使用App.Config文件中的值填充Checkedlistbox [英] How Do I Populate The Checkedlistbox With The Values In App.Config File
本文介绍了如何使用App.Config文件中的值填充Checkedlistbox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个app.config文件,其中包含键值对的某些设置。我需要在表单加载时使用这些值填充一个checkedboxlist。我怎么能编码呢?
I have an app.config file with certain settings with key-value pair. I need to populate a checkedboxlist with these values on form load. How can i code this?
推荐答案
你可以通过以下方式从App.config获取值:
You can get values from App.config by:
string filetype = ConfigurationSettings.AppSettings [ "filetype" ] ;
然后你可以填写checkedlistbox:
Then you can populate the checkedlistbox by:
var items = checkedListBox1.Items;
items.Add("Perls");
items.Add("Checked", true);
更多关于你的信息的参考:
用.NET 2.0读/写App.Config文件 [ ^ ]
从app.config读取值 [ ^ ]
^ ]
Some more reference for your clerance:
Read/Write App.Config File with .NET 2.0[^]
Reading values from app.config[^]
C# getting value from app.config[^]
这篇关于如何使用App.Config文件中的值填充Checkedlistbox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文