On Error Resume Next
Dim oStream, szMsg, szURL
szURL = "http://expert.csdn.net/Expert/topic/3025/3025367.xml?temp=.7882959"
Set x = Server.CreateObject("MSxml2.XMLHTTP")
x.Open "GET",szURL,False
x.send
Set oStream = Server.CreateObject("ADODB.Stream")
oStream.Type = 1
oStream.Open
oStream.Write x.responseBody
oStream.SaveToFile "c:\csdn.asp"
oStream.close
Dim oStream, szMsg, szURL
szURL = "http://expert.csdn.net/Expert/topic/3025/3025367.xml?temp=.7882959"
Set x = Server.CreateObject("MSxml2.XMLHTTP")
x.Open "GET",szURL,False
x.send
Set oStream = Server.CreateObject("ADODB.Stream")
oStream.Type = 1
oStream.Open
oStream.Write x.responseBody
oStream.SaveToFile "c:\csdn.asp"
oStream.close
解决方案 »
- <base target="_self">什么意思
- 大牛,看一下我下面这个js方法那里出错了
- 求一个判断域名现实广告的js代码
- ExtJs的grid显示不出来 高手 求教 帮忙看看
- 收藏 不显示删除回复显示所有回复显示星级回复显示得分回复 jQuery、html大牛麻烦进来帮帮忙,关于ol、li的问题
- 如何实现window.resizeend = alert("alreadyResized!");
- 布局小问题一个
- 求助一个关于格式控制的JS写法!!!
- 请问javascript可以判断表格中的数字是几吗?
- 如何在server端aspx.vb中拿confirm的值?
- 一个页面a 包含一个iframe页面b, c页面是b页面弹出的窗口,我想在c页面加个按钮使a页面刷新,请问这个教本怎样些
- 请问样式表里能否控制td的nowrap属性
请问还有其它方法没?
{
CInternetSession m_Session("DigitalTitan");
CHttpFile* pFile=NULL;
CException* e; TCHAR szTempPath[MAX_PATH],szTempFile[MAX_PATH];
DWORD dwResult=::GetTempPath(MAX_PATH,szTempPath);
CString strURLPath;
GetTempFileName(szTempPath,_T("DigitalTitan_"),0,szTempFile);
strURLPath=szTempFile;
TRY
{
pFile=(CHttpFile*)m_Session.OpenURL(strURL);
}
CATCH_ALL(e)
{
pFile=NULL;
AfxMessageBox("URL地址不合法",MB_ICONINFORMATION);
return "";
}
END_CATCH_ALL if(pFile)
{
DWORD dwStatus;
DWORD dwBufLen=sizeof(dwStatus);
BOOL bSuccess=pFile->QueryInfo(HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER,&dwStatus,&dwBufLen);
if(bSuccess&&dwStatus>=200&&dwStatus<300)
{
CStdioFile m_File;
if(m_File.Open(strURLPath,CFile::modeWrite|CFile::modeCreate|CFile::typeBinary))
{
BYTE pBuf[1024];
DWORD dwRead;
do
{
dwRead=pFile->Read(pBuf,1024);
m_File.Write(pBuf,dwRead);
}
while(dwRead>0);
m_File.Close();
}
}
pFile->Close();
delete pFile;
}
else
{
m_Session.Close();
}
return strURLPath;
}
谢谢你!
有没有这个例子的网页?