- 1. Fresh HTML(HTML編輯器)最新綠色免費版 V3.60
- 2. Becky! Internet Mail(支持html格式郵件) V2.57.01...
- 3. xhEditor(簡單迷你的可視化xhtml編輯器) V1.1.7
- 4. NK2Edit x64 (支持以text/html/xml的格式輸出) V1....
- 5. 網頁探針(查看網頁任意對象HTML源碼) V2.0 簡體中文...
- 6. 都市賽車6 (Asphalt 6)for Android v3.1.6 最...
- 7. 免費ASP論壇程序Web Wiz Forums v9.71 英文版
- 8. 0323版 (卡巴斯基反病毒)病毒庫 Kaspersky Anti-Vi...
- 9. 混淆代碼從而保護知識產權ASP混天綾 V 0.96
- 10. HTML 文件管家Dirhtml英文綠色免費 V4.8561 版
Asp生成html實例代碼的分享
這是一個ASP生成html的代碼,現在拿出來跟大家一起分享,希望對正在學習ASP的朋友們能夠有所幫助。
<%
Function GetPage(url)
'獲得文件內容
dim Retrieval
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False ', "", ""
.Send
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
'++++++++++++++++++++++++++++++++++++++++++++++++生成HTML文件開始
on error resume next
Url="http://www.pc-5.cn/txt/index-txt.asp"'要讀取的頁面地址
wstr = GetPage(Url)
'response.write(wstr)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
'if not MyFile.FolderExists(server.MapPath("/html/")) then
'MyFile.CreateFolder(server.MapPath("/html/"))'
'end if
'要存放的頁面地址
dizhi=server.MapPath("index.html")
If (fs.FileExists(dizhi)) Then
fs.DeleteFile(dizhi)
End If
Set CrFi=fs.CreateTextFile(dizhi)
Crfi.Writeline(wstr)
set CrFi=nothing
set fs=nothing
'++++++++++++++++++++++++++++++++++++++++++++++++生成HTML文件結束
'循環生成文章開始
for i=1 to 3026 step 1
'++++++++++++++++++++++++++++++++++++++++++++++++生成HTML文件開始
on error resume next
Url=http://www.pc-5.cn/txt/list.asp?id=100'要讀取的頁面地址
wstr = GetPage(Url)
'response.write(wstr)
Set fs=Server.CreateObject("Scripting.FileSystemObject")
'if not MyFile.FolderExists(server.MapPath("/html/")) then
'MyFile.CreateFolder(server.MapPath("/html/"))'
'end if
'要存放的頁面地址
dizhi=server.MapPath("100.html")
If (fs.FileExists(dizhi)) Then
fs.DeleteFile(dizhi)
End If
Set CrFi=fs.CreateTextFile(dizhi)
Crfi.Writeline(wstr)
set CrFi=nothing
set fs=nothing
'++++++++++++++++++++++++++++++++++++++++++++++++生成HTML文件結束
next
'循環生成文章結束
response.write("已經生成所有首頁調用的標題,請返回!")
Response.redirect(request.servervariables("http_referer"))
%>