HINTERNET hSession = InternetOpen( "Agent ", 0,NULL, NULL, 0);
HINTERNET hOpener = InternetOpenUrl(hSession,
"http://www.csdn.net/some/path/file.html ", NULL,0, 1, 1);
DWORD dwStatus;
DWORD dwBuffLen = sizeof(dwStatus);
BOOL bSuccess =HttpQueryInfo(hOpener,
HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER,
&dwStatus, &dwBuffLen, 0);
if( bSuccess && dwStatus==404 ){
//文件未找到
}
InternetCloseHandle(hOpener);
InternetCloseHandle(hSession