asp

位置:IT落伍者 >> asp >> 浏览文章

asp生成html简单实现程序


发布日期:2023年08月22日
 
asp生成html简单实现程序

代码如下

Function getHttpXML()

Set Http = ServerCreateObject("MsxmlServerXMLHTTP")

dim lResolvelConnectlSendlReceive

lResolve = *

lConnect = *

lSend = *

lReceive = *

HttpsetTimeouts lResolvelConnectlSendlReceive

Httpopen "POST""false 抓取需要生成html的页面

HttpSend()

if Httpreadystate = then str=timer()

if Httpreadystate = then str=timer()

if Httpreadystate <> then

exit Function

end if

if Httpreadystate = then str=timer()

getHttpXML=BytesToBstr(HttpresponseBody"utf")

getHttpXML=HttpresponseBody

getHttpXML=FormatNumber((strstr)/)

if errNumber<> then errClear

End Function

生成文件

Function SaveToFile()

Dim objStream

On Error Resume Next

Set objStream = ServerCreateObject("ADODBStream")

If ErrNumber= Then

ResponseWrite "

非常遗憾您的主机不支持ADODBStream不能使用本程序

"

ErrClear

ResponseEnd

End If

With objStream

Type =

Open

Charset = "utf"

write getHttpXML

SaveToFile ServerMapPath("indexhtml")

Close

End With

Set objStream = Nothing

End Function

call SaveToFile()

上一篇:asp 数组动态定义数组与静态数据定义方法

下一篇:站长必收藏的一些ASP代码