M
mstlq
Unregistered / Unconfirmed
GUEST, unregistred user!
小弟成功用一个CInternetFile类*pF打开了一个ftp上的文件,当我想调用*pF的seek方法时却出现了异常,显示“操作成功完成”,而实际上文件指针并没有定位到我想要的地方而是停在了文件头,到底问题出现哪里?希望大家不吝赐教!
CInternetSession *pmy_InternetSession;
pmy_InternetSession = new CInternetSession(NULL,1,INTERNET_OPEN_TYPE_DIRECT ,NULL,NULL,0);
CFtpConnection *pmy_FtpConnection;
pmy_FtpConnection = pmy_InternetSession->GetFtpConnection ("218.192.161.105",NULL,NULL,21,TRUE );
CInternetFile* pF=pmy_FtpConnection->OpenFile("1.txt", GENERIC_READ ,FTP_TRANSFER_TYPE_ASCII ,1);
pF->SeekToend;
try { (*pF).Seek(3,CFile::begin
);} //出错部分,抛出异常“操作成功完成”
catch (CInternetException *e)
{e->
ReportError() }
CInternetSession *pmy_InternetSession;
pmy_InternetSession = new CInternetSession(NULL,1,INTERNET_OPEN_TYPE_DIRECT ,NULL,NULL,0);
CFtpConnection *pmy_FtpConnection;
pmy_FtpConnection = pmy_InternetSession->GetFtpConnection ("218.192.161.105",NULL,NULL,21,TRUE );
CInternetFile* pF=pmy_FtpConnection->OpenFile("1.txt", GENERIC_READ ,FTP_TRANSFER_TYPE_ASCII ,1);
pF->SeekToend;
try { (*pF).Seek(3,CFile::begin
);} //出错部分,抛出异常“操作成功完成”
catch (CInternetException *e)
{e->
ReportError() }