C#中什么类有读取下面配置文件的功能? 在db.cfg文件里面有下面数据,在C#中用什么类来实现读取那?host=192.168.1.100port=3306user=rootpassword=8692888谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string path="f:/db.cfg";using (StreamReader sr = File.OpenText(path)) { string s = ""; while ((s = sr.ReadLine()) != null) { MessageBox.Show(s); }} string path="f:/db.cfg";using (StreamReader sr = File.OpenText(path)) { string s = ""; while ((s = sr.ReadLine()) != null) { MessageBox.Show("key:"+ s.split('=')[0] + "value:"+ s.split('=')[1]); }} 当前应用程序的路径Application.StartupPath 怎么知道string对象的最后一个字符是是否是'\'字符呢? [求助]两次通过DateTime.Now.Hour获得的Hour不相同 XML空值结点问题 Ctrl+Mouse Wheel zoom a Picture ,WinForm实现方法 datagrid问题 弱问:如何将object强制转换成数组? 求助 ,想实现 显示 几何图形 ? 如何获得webform gridview页面数据? :::C#绘图__高深(需求看贴子)__高分::: 初学者问题,读取dataset数据,谢谢 C# 怎么通过反射取得已经加载的DLL中的静态变量 请教如何定制NET的生成控件命名规则? 连接数据库后,怎么样提取表项的值?
using (StreamReader sr = File.OpenText(path))
{
string s = "";
while ((s = sr.ReadLine()) != null)
{
MessageBox.Show(s);
}
}
using (StreamReader sr = File.OpenText(path))
{
string s = "";
while ((s = sr.ReadLine()) != null)
{
MessageBox.Show("key:"+ s.split('=')[0] + "value:"+ s.split('=')[1]);
}
}
Application.StartupPath