如何读取文本文件,并且此值如何在app.config中更新? [英] How to read text file and this values how to update in app.config?
本文介绍了如何读取文本文件,并且此值如何在app.config中更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何读取文本文件以及此值如何在app.config中更新?
How to read text file and this values how to update in app.config?
推荐答案
请参阅此cp文章.
使用.NET 2.0读/写App.Config文件 [
Look at this cp article.
Read/Write App.Config File with .NET 2.0[^]
尝试以下操作:
foreach(ConfigurationManager.AppSettings中的字符串键)
{
//获取密钥
字符串值= ConfigurationManager.AppSettings [key];
this.Url =值;
}
有关更多详细信息,请检查以下链接:从App.Config读取密钥
Try this:
foreach (string key in ConfigurationManager.AppSettings)
{
//Get your key
string value = ConfigurationManager.AppSettings[key];
this.Url = value;
}
For more details, check this link: Reading Keys from App.Config
这篇关于如何读取文本文件,并且此值如何在app.config中更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文