Ini.IniFile inf = new Ini.IniFile("c:\\u.txt");
ArrayList list = new ArrayList();
bool listbool = true;
int ii = 1;
while (listbool)
{
string tmp = inf.IniReadValue("usernum", ii.ToString()); if (tmp.Length > 2)
{
list.Add(tmp);
ii++;
}
else
{
listbool = false;
} }
=========================================================
我知道我这代码有问题,呵呵前辈帮忙改下。多谢了
ArrayList list = new ArrayList();
bool listbool = true;
int ii = 1;
while (listbool)
{
string tmp = inf.IniReadValue("usernum", ii.ToString()); if (tmp.Length > 2)
{
list.Add(tmp);
ii++;
}
else
{
listbool = false;
} }
=========================================================
我知道我这代码有问题,呵呵前辈帮忙改下。多谢了
private static extern bool GetPrivateProfileString(
string lpApplicationName,
string lpKeyName,
string lpDefault,
StringBuilder lpReturnedString ,
int nSize,
string lpFileName);
读取ini文件参考
你这是循环读取TXT每行的内容而已...
一楼给出的是读取INI的 API