override CWnd::OnAmbientProperty Download Control Hosts can control certain aspects of downloading—frames, images, Java, and so on—by implementing both IOleClientSite and an ambient property defined as DISPID_AMBIENT_DLCONTROL. When the host's IDispatch::Invoke method is called with dispidMember set to DISPID_AMBIENT_DLCONTROL, it should place zero or a combination of the following values in pvarResult.DLCTL_DLIMAGES The browsing component will download images from the server.
利用Java编写HTML文件分析程序
http://202.120.223.182/kejian/classroom/java/J2SE/46.html
Download Control
Hosts can control certain aspects of downloading—frames, images, Java, and so on—by implementing both IOleClientSite and an ambient property defined as DISPID_AMBIENT_DLCONTROL. When the host's IDispatch::Invoke method is called with dispidMember set to DISPID_AMBIENT_DLCONTROL, it should place zero or a combination of the following values in pvarResult.DLCTL_DLIMAGES The browsing component will download images from the server.
//这样不可能将图片一起下载的
CInternetSession session;
CHttpFile *file;
CString str;
UpdateData(TRUE);
if(m_ifrom>m_ito) AfxMessageBox("输入顺序不对");
//http://www.versiontracker.com/mp/devinfoapp.m?ID=10000&OS_Filter=Windows
for(int i=10000;i<10001;i++)
{
char bufa[20];
itoa(i,bufa,10);
// AfxMessageBox(bufa);
m_strURL="http://www.versiontracker.com/mp/devinfoapp.m?ID=";
CString szurl=m_strURL+bufa;
CString temp2="&OS_Filter=Windows";
szurl=szurl+temp2;
strcat(bufa,".html");
CFile fileout;
CString str="C:\\dwonloadhtml\\";
str=str+bufa;
// AfxMessageBox(str);
fileout.Open(str,CFile::modeCreate|CFile::modeWrite,NULL);
file=(CHttpFile *)session.OpenURL(szurl);
char buf[1025];
memset(buf,0x00,1025);
if(file==NULL)
AfxMessageBox("connect failed");
CString strs;
strs.Empty();
while(file->ReadString(strs))
{
int len=strs.GetLength();
fileout.Write(strs,len); }
fileout.Close();
file->Close();
}
session.Close();