asp生成html简单实现程序
发布时间:2016-09-24 编辑:jiaochengji.com
教程集为您提供asp生成html简单实现程序等资源,欢迎您收藏本站,我们将为您提供最新的asp生成html简单实现程序资源
本文章介绍了关于asp生成html简单实现程序,有需要的朋友可参考一下。
<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy6122')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy6122>Function getHttpXML()Set Http = Server.CreateObject("Msxml2.ServerXMLHTTP")
dim lResolve,lConnect,lSend,lReceive
lResolve = 5*1000
lConnect = 5*1000
lSend = 15*1000
lReceive = 15*1000
Http.setTimeouts lResolve,lConnect,lSend,lReceive
Http.open "POST","http://www.jiaochengji.com",false '抓取需要生成html的页面
Http.Send()
if Http.readystate =1 then str1=timer()
if Http.readystate =4 then str2=timer()
if Http.readystate <> 4 then
exit Function
end if
'if Http.readystate =0 then str1=timer()
'getHttpXML=BytesToBstr(Http.responseBody,"utf-8")
getHttpXML=Http.responseBody
'getHttpXML=FormatNumber((str2-str1)/1000,3)
if err.Number<>0 then err.Clear
End Function
'生成文件
Function SaveToFile()
Dim objStream
On Error Resume Next
Set objStream = Server.CreateObject("ADODB.Stream")
If Err.Number=-2147221005 Then
Response.Write "<div align='center'>非常遗憾,您的主机不支持ADODB.Stream,不能使用本程序</div>"
Err.Clear
Response.End
End If
With objStream
.Type = 1
.Open
.Charset = "utf-8"
.write getHttpXML
.SaveToFile Server.MapPath("index.html"),2
.Close
End With
Set objStream = Nothing
End Function
call SaveToFile()
您可能感兴趣的文章:
有关微软新一代开发技术ASP 的介绍
ASP 3.0高级编程(十一)
asp和php哪个好?
Active Server Pages + 介绍
常用的 ASP ActiveX 组件
asp 中文教程(二)-- Asp Web Forms
asp 有关上传图片的问题?
ASP基础
处理ASP请求的内部讨论
asp 与asp的区别(1)
上一篇:asp判断是否手机用户访问网站
下一篇:asp中的一些日期时间函数
[关闭]