变态重口极致另类在线-波多久久夜色精品国产-波多野结衣在线观看一区-波多野结衣在线观看一区二区-污污的网站免费阅读-污污视频网址

當前位置:首頁文章首頁 IT學院 IT技術

Asp生成html實例代碼的分享

作者:  來源:  發布時間:2011-6-2 9:35:55  點擊:

這是一個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"))
%>

文章評論

軟件按字母排列: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
主站蜘蛛池模板: 一级片免费观看视频 | 日本三级带日本三级带黄首页 | 狠狠久久综合伊人不卡 | www.欧美xxx| 久久人人爽人人爽人人小说 | 国产福利微拍精品一区二区 | 欧美三级香港三级日本三级 | 欧美成人高清视频 | 免费观看一级欧美在线视频 | 日本免费福利视频 | 国产亚洲91| 丁香综合激情 | 成人影院在线看 | 在线观看一区二区精品视频 | 黄色三级国产 | 成人不卡在线 | 香蕉视频三级 | 怡春院院日本一区二区久久 | 真正免费一级毛片在线播放 | 狠狠成人 | 亚洲一区不卡 | 久久精品国产99国产精偷 | 国产精品视频成人 | 热综合一本伊人久久精品 | 欧美精品久久一区二区三区 | 国产全黄三级国产全黄三级书 | 国产bbwbbwbbwbbw | 一区二区欧美视频 | 五月天在线观看免费视频播放 | 毛片免费毛片一级jjj毛片 | 这里只有精品在线播放 | 国产全黄三级三级 | 色噜噜狠狠色综合日日 | 成人va | 国产大片中文字幕在线观看 | 丁香欧美 | 手机福利视频一区二区 | 青春草在线视频 | 日本夜夜夜 | 欧洲视频一区 | 欧美日韩亚洲第一页 |