65,211
社区成员
发帖
与我相关
我的任务
分享
void genJianTao(size_t szNum)
{
ofstream _os("d:\\Jiantao.txt");
if(_os)
{
for(int i=0;i<szNum;i+=2)
{
_os<<"检讨" ;
}
}
}
char buf[MAX_PATH]; //读到的数据
CString chanel; //字段名
for (int j = 1; ; j++)
{
chanel.Format("Channel%d", j);
::GetPrivateProfileString(
"UserChanelConfig", //项名
chanel, //字段名
"", //读取失败的默认值
buf, //存入
sizeof(buf), //存储大小
"chanel.ini" //读取的文件的名字,包含路径
);
if (strlen(buf) < 0) //读取失败,跳出循环
break;
CString first, second, last;
//以逗号分隔
CString temp = buf;
//第一部分
int n = temp.Find(',');
first = temp.Left(n-1);
//第三部分
int m = temp.ReverseFind(',');
last = temp.Right(m);
//第二部分
temp = temp.Left(m-1);
second = temp.Right(temp.GetLength()-n);
//下面是存储到list,和Java类似,你自己写吧!
}