NOTE - wangxg97的BLOG http://wangxg97.52rd.net - 复制 - 收藏
毅 发表于 2007-11-1 0:02:00

 CStdioFile mFile;
  CFileException  mExcept;
  CString strout,tmp,tmp1;
  int strpos=0;
     mFile.Open("c:\\msg.txt", CFile::modeWrite, &mExcept);
  CString strin="sMSG00000001\n0000|0001:100\n0000|0003:200\n";
  mFile.WriteString(strin);
  strin="MSG00000002\n0000|0002:100\n";
  mFile.WriteString(strin);
  mFile.Close();
   CFile file("c:\\msg.txt",CFile::modeNoTruncate|CFile::modeReadWrite);
  char *pBuf=new char[file.GetLength()+1];
  ZeroMemory(pBuf,file.GetLength()+1);  
  file.Read(pBuf,file.GetLength());
  tmp=pBuf;
  while(tmp.Find("MSG",strpos)+1)
  {
  strpos=tmp.Find("MSG",strpos+1);
  tmp1="";

  }
  file.Close();

  mFile.Open("c:\\msg.txt", CFile::modeReadWrite, &mExcept);  

  while(mFile.ReadString(strout))
  {
   if(!strout.Find("MSG",0))
   {
   tmp=strout;
   }
   else
   {
   tmp1=strout;

   }

  }

阅读全文(2043) | 评论(0)
评 论
昵 称: 匿名
验证码: 2485
博 主
进入wangxg97的首页
博客名称:NOTE
日志总数:14
评论数量:5
访问次数:26997
建立时间:2007年3月14日
导 航
日 历
«September 2010»
1234
567891011
12131415161718
19202122232425
2627282930
公 告
暂无公告...
日 志
评 论
52RD网友谢谢谢谢(11-12)
52RD网友在输入Auto-refresh命令后,一般要跟几句空操...(8-30)
jlj714good!(1-18)
binggan8043WO  DING  NI  ...(5-6)
3145(游客)"本书"??所讨论的S3C4510B??(3-18)
链 接