void wfc_get_web_page( CUniformResourceLocator& url, CStringArray& page_contents, DWORD options )
void wfc_get_web_page( CUniformResourceLocator& url, CByteArray& page_contents, DWORD options )
The default options are:
INTERNET_FLAG_RELOAD |
Microsoft (Internet Explorer) tries to "help" you by caching web pages that you have visited. This flag tell Microsoft to stop helping and just go to the website and retrieve the page. |
INTERNET_FLAG_TRANSFER_ASCII |
Can't remember why I have this flag or if it is even needed. |
INTERNET_FLAG_NO_CACHE_WRITE |
Tells Microsoft (Internet Explorer) to stop "helping" me by writing the retrieved web page to a cache. This flags prevents the web page from being written to the browser cache. |
INTERNET_FLAG_IGNORE_CERT_CN_INVALID |
Ignores invalid certificates when retrieving a secure web page. |
INTERNET_FLAG_IGNORE_CERT_DATE_INVALID |
Ignores invalid certificates when retrieving a secure web page. |
void print_maryland_weather_report( void )
{
WFCTRACEINIT( TEXT( "print_maryland_weather_report()" ) );
CUniformResourceLocator url( TEXT( "http://iwin.nws.noaa.gov/iwin/md/hourly.html" ) );
CStringArray weather_report;
wfc_get_web_page( url, weather_report );
int index = 0;
int number_of_lines_in_report = weather_report.GetSize();
while( index < number_of_lines_in_report )
{
_tprintf( TEXT( "%s\n" ), (LPCTSTR) weather_report.GetAt( index ) );
index++;
}
}