CStringArray   strarray;   
  CStdioFile   file;  
  CString   strLine; 
    if(   !file.Open("3.txt",   CFile::modeRead)   )   
  {  
  AfxMessageBox("can   not   open   file!");   
  return;   
  }   
   while(file.ReadString(strLine))   
  {   
strarray.Add(strLine);   
  }   
  file.Close();   
  
    CString   str; 
    if(   !file.Open("4.txt",   CFile::modeCreate|CFile::modeWrite)   )   
  {   
  AfxMessageBox("can   not   open   file!");   
  return;   
  }     for(int i=0;   i<strarray.GetSize();   i++)   
  {   
  str   =   "";   
  str   =   strarray[i] ;  
  if(   str.Find("->")   !=   -1)   //我想实现如果找到"->",就在前面插入1,第二次找到插入2,……
  { 
  int j=1;
  str="j"+strarray[i]   +"\n";
 j++;
  }
  else
  str=strarray[i]   +"\n";
  
  file.WriteString(str);   
  }   
  file.Close();   
}但是实际上我的结果如下
源文件
 192.168.24.84 -> 192.168.24.1  DHCP DHCP Request 
00 0d 88 4a 7d c7 00 e0  fc 01 01 06 08 00 45 00
00 64 00 00 00 00 ff 11  3c bd ab 64 14 02 ab 64
14 01 9c 40 17 70 00 50  00 00 00 05 00 01 00 25
43 10 4a 6d ce e9 00 00  00 00 00 00 00 00 00 01
00 00 a0 55 01 02 a0 00  00 01 00 00 00 00 00 19
00 00 00 00 0d 80 00 05  97 00 00 24 fc 0c 00 25
0c 06 04 00 03 e8 00 00  06 00 00 00 00 00 00 00
00 00  
 192.168.24.84 -> 192.168.24.1  DHCP DHCP Request 
00 0d 88 4a 7d c7 00 e0  fc 01 01 06 08 00 45 00
00 64 00 00 00 00 ff 11  3c bd ab 64 14 02 ab 64
14 01 9c 40 17 70 00 50  00 00 00 05 00 01 00 25
43 10 4a 6d ce e9 00 00  00 00 00 00 00 00 00 01
00 00 a0 55 01 02 a0 00  00 01 00 00 00 00 00 19
00 00 00 00 0d 80 00 05  97 00 00 24 fc 0c 00 25
0c 06 04 00 03 e8 00 00  06 00 00 00 00 00 00 00
00 00  
 192.168.24.84 -> 192.168.24.1  DHCP DHCP Request 
00 0d 88 4a 7d c7 00 e0  fc 01 01 06 08 00 45 00
00 64 00 00 00 00 ff 11  3c bd ab 64 14 02 ab 64
14 01 9c 40 17 70 00 50  00 00 00 05 00 01 00 25
43 10 4a 6d ce e9 00 00  00 00 00 00 00 00 00 01
00 00 a0 55 01 02 a0 00  00 01 00 00 00 00 00 19
00 00 00 00 0d 80 00 05  97 00 00 24 fc 0c 00 25
0c 06 04 00 03 e8 00 00  06 00 00 00 00 00 00 00
00 00  
生成的文件,都加了一个j,而不是1,2,3
j 192.168.24.84 -> 192.168.24.1  DHCP DHCP Request 
00 0d 88 4a 7d c7 00 e0  fc 01 01 06 08 00 45 00
00 64 00 00 00 00 ff 11  3c bd ab 64 14 02 ab 64
14 01 9c 40 17 70 00 50  00 00 00 05 00 01 00 25
43 10 4a 6d ce e9 00 00  00 00 00 00 00 00 00 01
00 00 a0 55 01 02 a0 00  00 01 00 00 00 00 00 19
00 00 00 00 0d 80 00 05  97 00 00 24 fc 0c 00 25
0c 06 04 00 03 e8 00 00  06 00 00 00 00 00 00 00
00 00  
j 192.168.24.84 -> 192.168.24.1  DHCP DHCP Request 
00 0d 88 4a 7d c7 00 e0  fc 01 01 06 08 00 45 00
00 64 00 00 00 00 ff 11  3c bd ab 64 14 02 ab 64
14 01 9c 40 17 70 00 50  00 00 00 05 00 01 00 25
43 10 4a 6d ce e9 00 00  00 00 00 00 00 00 00 01
00 00 a0 55 01 02 a0 00  00 01 00 00 00 00 00 19
00 00 00 00 0d 80 00 05  97 00 00 24 fc 0c 00 25
0c 06 04 00 03 e8 00 00  06 00 00 00 00 00 00 00
00 00  
j 192.168.24.84 -> 192.168.24.1  DHCP DHCP Request 
00 0d 88 4a 7d c7 00 e0  fc 01 01 06 08 00 45 00
00 64 00 00 00 00 ff 11  3c bd ab 64 14 02 ab 64
14 01 9c 40 17 70 00 50  00 00 00 05 00 01 00 25
43 10 4a 6d ce e9 00 00  00 00 00 00 00 00 00 01
00 00 a0 55 01 02 a0 00  00 01 00 00 00 00 00 19
00 00 00 00 0d 80 00 05  97 00 00 24 fc 0c 00 25
0c 06 04 00 03 e8 00 00  06 00 00 00 00 00 00 00
00 00 
请问高手到底怎么实现啊