📄 makehtml.asp
字号:
<%
'以下的函数为XMLHTTP捉取远程数据显示出来的东西,呵,也就是用来生成HTML的
Function getHTTPPage(Path)
t = GetBody(Path)
getHTTPPage=BytesToBstr(t,"GB2312")
End function
Function GetBody(url)
on error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetBody = .ResponseBody
End With
Set Retrieval = Nothing
End Function
Function BytesToBstr(body,Cset)
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 = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
%>
<%
sub makehtml(uname,fname)
mydsn=""
'mydsn为模板文件所在的路径
url=mydsn & uname
body=getHTTPPage(url)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.Createtextfile(server.mappath(fname),true)
fout.writeline body
fout.close
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -