Generate an HTML file with the specified ASP file content

xiaoxiao2021-03-06  39

<%

Function getPage (URL)

Dim Retrieval

Set Retrieval = CreateObject ("Microsoft.xmlhttp")

With retrieval

.Open "get", URL, FALSE ', "" ""

Ssend

GetPage = Bytestobstr (.responsebody)

End with

Set Retrieval = Nothing

END FUNCTION

Function Bytestobstr (body)

DIM Objstream

Set objstream = Server.createObject ("adodb.stream")

Objstream.Type = 1

Objstream.mode = 3

Objstream.open

Objstream.Write Body

Objstream.position = 0

Objstream.Type = 2

Objstream.charset = "GB2312"

Bytestobstr = Objstream.readtext

Objstream.close

Set objstream = Nothing

END FUNCTION

ON Error ResMe next

URL = "http://www.taing.com.cn/index.asp"

Response.write "Start Update Home ..."

WSTR = GetPage (URL)

SET FS = Server.createObject ("scripting.filesystemobject")

'if not myfile.folderexists (Server.MAppath ("/ html /")) THEN

'Myfile.createfolder (Server.mAppath ("/ html /"))

'end if

IF (fs.fileexists (server.mappath ("." ")") .Htm ").

fs.deletefile (Server.MAppath ("." "" "."

END IF

SET CRFI = fs.createtextfile (Server.mAppath ("." ")

CRFI.WRITELINE (WSTR)

SET CRFI = Nothing

SET FS = Nothing

Response.write "... update complete! "

%>

转载请注明原文地址:https://www.9cbs.com/read-76402.html

New Post(0)