MFC,解析ftp响应文件列表行的任何解决方案

时间:2014-07-01 01:40:43

标签: parsing mfc ftp

将任何库解析解析为跟随文件列表字符串

0x001d8f60 "-rw-------   1 root     root     000000000 Jun 30 2014 YS_LIANG
drw-------   1 root     root     000000000 Jun 30 2014 2014-05-08 [][][] - [][][][]
drw-------   1 root     root     000000000 Jun 30 2014 FTPClient-WinCE
drw-------   1 root     root     000000000 Jun 30 2014 GRAPHIC
drw-------   1 root     root     000000000 Jun 30 2014 S8521 V1.6.17
drw-------   1 root     root     000000000 Jun 30 2014 S8521V1.7.0
drw-------   1 root     root     000000000 Jun 30 2014 Storage Card2
drw-------   1 root     root     000000000 Jun 30 2014 UltraEdit 18.20.0.1021
drw-------   1 root     root     000000000 Jun 30 2014 usb wireless driver
drw-------   1 root     root     000000000 Jun 30 2014 Windows7 ActiveSync
-rw-------   1 root     root     101384240 Jun 28 2013 avira_free_antivirus_zhtw.exe
-rw-------   1 root     root     000564736 Jun 21 2011 ComTest.exe
-rw-------   1 root     root     000000189 Feb 10 2014 ComTest.INI
-rw-------   1 root     root     006465536 May 5 2014 DR12AsyncSocket.exe
-r"

由于

1 个答案:

答案 0 :(得分:0)

好的,我得到了解决方案。

while(true)
{
nNewLineIdx = strRespFileList.Find(_T("\r\n"));
if(nNewLineIdx == -1)
{
    break;
} 
    // TODO : Save in CStringArray
}

// Parse CString line of CStringArray
for(int loop=0; loop<CStringArray.GetCount();loop++)
{
int strLineLen = CStringArray.GetAt(loop).GetLength();
int nSerchLoc = 0;
int nStep = 0;
while(nSerchLoc < strLineLen)
{
    CString strTok = CStringArray.GetAt(loop).Tokenize(_T(" "), nSerchLoc);
    // TODO : Save cut information
}
}