主頁 > 知識庫 > asp生成靜態(tài)HTML(動態(tài)讀取)

asp生成靜態(tài)HTML(動態(tài)讀取)

熱門標(biāo)簽:梧州市地圖標(biāo)注 外呼線路批發(fā) 武穴地圖標(biāo)注 創(chuàng)意電話機(jī)器人 石家莊慧營銷外呼系統(tǒng) 濟(jì)源電銷外呼系統(tǒng)線路 地圖標(biāo)注陽江 java外呼系統(tǒng)是什么 世界地圖標(biāo)注了哪些城市
復(fù)制代碼 代碼如下:

!--#include file="admin_Checkuser.asp"-->
 %
call ConnectionDatabase()
dim str,str_new
str=""
str_new=""
sqlx="select id from Fl_Products order by id desc"
set rsx=conn.execute(sqlx)
do while not rsx.eof
str=strrsx("id")"|"
rsx.movenext :loop
rsx.close
sqlx="select id from Fl_News order by id desc"
set rsx=conn.execute(sqlx)
do while not rsx.eof
str_new=str_newrsx("id")"|"
rsx.movenext :loop
rsx.close
place=InStrRev(str,"|")
str=Left(str,place-1)
place=InStrRev(str_new,"|")
str_new=Left(str_new,place-1)
 dim url,cwww,act
 act=Trim(Request.QueryString("act"))
url =Request.ServerVariables("HTTP_HOST")
cwww="http://"+url
    MakeHtm cwww"/index.asp","../index.htm","首頁寫入成功!"
    MakeHtm cwww"/about.asp","../about.htm","企業(yè)簡介寫入成功!"
MakeHtm cwww"/contact.asp","../contact.htm","聯(lián)系我們寫入成功!"
MakeHtm cwww"/ry.asp","../ry.htm","資質(zhì)榮譽(yù)寫入成功!"
MakeHtm cwww"/liuyan.asp","../liuyan.htm","聯(lián)系我們寫入成功!"
MakeHtm cwww"/pro.asp","../pro.htm","產(chǎn)品展示寫入成功!"
MakeHtm cwww"/news.asp","../news.htm","生成車間寫入成功!"
    MakeHtm cwww"/xinwen.asp","../xinwen.htm","新聞資訊寫入成功!"
    MakeHtm cwww"/alliance.asp","../alliance.htm","銷售網(wǎng)絡(luò)寫入成功!"
'生成產(chǎn)品
xstr=split(str,"|")
for i=0 to ubound(xstr)
MakeHtm cwww"/uzProduct.asp?id="xstr(i),"../uzProduct_"xstr(i)".htm","產(chǎn)品"xstr(i)"寫入成功!"
next
xstr=split(str_new,"|")
for i=1 to ubound(xstr)/25+1
MakeHtm cwww"/xinwen.asp?Page="i,"../xinwen_"i".htm","新聞列表"i"寫入成功!"
next
xstr=split(str_new,"|")
for i=0 to ubound(xstr)
MakeHtm cwww"/uzNews.asp?id="xstr(i),"../uzNews_"xstr(i)".htm","新聞"xstr(i)"寫入成功!"
next
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
 Function MakeHtm(curl,turl,mess)
 Set xml = Server.CreateObject("Microsoft.XMLHTTP")
'把下面的地址替換成你的首頁的文件地址,一定要用http://開頭的絕對路徑,不能寫相對路徑
xml.Open "GET", curl, False
xml.Send
BodyText=xml.ResponseBody
BodyText=BytesToBstr(BodyText,"gb2312")
Set xml = Nothing
 '替換
 BodyText=RegReplace(BodyText,"uzProduct\.asp\?id=(\d*)", "uzProduct_$1.htm")
 BodyText=RegReplace(BodyText,"uzNews\.asp\?id=(\d*)", "uzNews_$1.htm")
 BodyText=RegReplace(BodyText,"xinwen\.asp\?Page=(\d*)", "xinwen_$1.htm")
 BodyText=replace(BodyText,"index.asp","index.htm")
 BodyText=replace(BodyText,"about.asp","about.htm")
 BodyText=replace(BodyText,"pro.asp","pro.htm")
 BodyText=replace(BodyText,"news.asp","news.htm")
 BodyText=replace(BodyText,"liuyan.asp","liuyan.htm")
 BodyText=replace(BodyText,"ry.asp","ry.htm")
 BodyText=replace(BodyText,"xinwen.asp","xinwen.htm")
 BodyText=replace(BodyText,"contact.asp","contact.htm")
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile= fso.CreateTextFile(server.MapPath(turl), True)
MyFile.WriteLine(BodyText)
MyFile.Close
response.Write mess
response.Write "br>"
End Function
Public Function RegReplace(sContent, sPatrn, sNewStr)
        Dim oTempReg : Set oTempReg = New RegExp
        With oTempReg
                .IgnoreCase = True
                .Global = True
                .Pattern = sPatrn
                RegReplace = .Replace(sContent, sNewStr)
        End With
        Set oTempReg = Nothing
End Function
call CloseDatabase()
  %>
  html>
head>
meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
title>Untitled Document/title>
style>
body,td{font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:10.5pt;}
/style>
/head>
body>
/body>
/html>


來自 iisboy
您可能感興趣的文章:
  • asp添加數(shù)據(jù)實(shí)現(xiàn)代碼
  • ASP.NET動態(tài)生成靜態(tài)頁面的實(shí)例代碼
  • Asp.net動態(tài)生成html頁面的方法分享
  • 一個(gè)ASP創(chuàng)建動態(tài)對象的工廠類(類似PHP的stdClass)
  • asp.net后臺動態(tài)添加JS文件和css文件的引用實(shí)現(xiàn)方法
  • asp.net后臺如何動態(tài)添加JS文件和css文件的引用
  • asp.net通過動態(tài)加載不同CSS實(shí)現(xiàn)多界面
  • asp.net在后端動態(tài)添加樣式表調(diào)用的方法
  • asp.net動態(tài)添加js文件調(diào)用到網(wǎng)頁的方法
  • asp.net為網(wǎng)頁動態(tài)添加關(guān)鍵詞的方法
  • asp.net動態(tài)加載自定義控件的方法
  • ASP.NET創(chuàng)建動態(tài)縮略圖的方法
  • asp+jsp+JavaScript動態(tài)實(shí)現(xiàn)添加數(shù)據(jù)行

標(biāo)簽:甘南 揭陽 迪慶 來賓 淮北 唐山 滁州 南寧

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《asp生成靜態(tài)HTML(動態(tài)讀取)》,本文關(guān)鍵詞  asp,生成,靜態(tài),HTML,動態(tài),;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《asp生成靜態(tài)HTML(動態(tài)讀取)》相關(guān)的同類信息!
  • 本頁收集關(guān)于asp生成靜態(tài)HTML(動態(tài)讀取)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章