CInternetFile* pFile = NULL;
CInternetSession InetSession;
try
{
pFile = (CInternetFile *)InetSession.OpenURL( "URL 주소 : http://???" );
}
catch(CInternetException *pEx)
{
pFile = NULL;
pEx = NULL;
AfxMessageBox( "OpenURL Excption Error!" );
}
CString strData;
if( pFile )
{
CString strTemp;
pFile->SetReadBufferSize( 4096 );
while( true )
{
if( pFile->ReadString( strTemp ) )
{
strTemp += "\r\n";
strData += strTemp;
}
else
{
break;
}
}
}
else
{
AfxMessageBox( "OpenURL pFile is NULL!!" );
}
MessageBox( strData );
CInternetSession InetSession;
try
{
pFile = (CInternetFile *)InetSession.OpenURL( "URL 주소 : http://???" );
}
catch(CInternetException *pEx)
{
pFile = NULL;
pEx = NULL;
AfxMessageBox( "OpenURL Excption Error!" );
}
CString strData;
if( pFile )
{
CString strTemp;
pFile->SetReadBufferSize( 4096 );
while( true )
{
if( pFile->ReadString( strTemp ) )
{
strTemp += "\r\n";
strData += strTemp;
}
else
{
break;
}
}
}
else
{
AfxMessageBox( "OpenURL pFile is NULL!!" );
}
MessageBox( strData );
덧글을 달아 주세요