asp網站制作教程之ASP生成html方法
2012/5/14 14:55:32
    <%
    '當目標頁面的包含文件即#include的頁面里邊存在response.End()的時候本程序有問題
    '注意:本文件一定要放在20041227111723.htm指向的文件的同一目錄下
    dim hughchiu_rtcode
    Function get_exe_code(20041227111723.htm)
    dim execode
    dim tmp_str
    Dim re,re1,content,fso,f,aspStart,aspEnd
    dim ms,m
    execode = ""
    set fso=CreateObject("Scripting.FileSystemObject")
    set f=fso.OpenTextFile(server.mappath(20041227111723.htm))
    content=f.ReadAll
    f.close
    set f=nothing
    set fso=nothing
    set re = new regexp
    re.ignorecase = true
    re.global = true
    re.pattern = "\<\%\@[^\%]+\%\>"
    content = re.replace(content,"")
    re.global = false
    re.pattern = "\<\!\-\-\s*\#include\s*file\s*=\s*\""([^\""]+)\""\s*\-\-\>"
    do
    set ms = re.execute(content)
    if ms.count<>0 then
    set m = ms(0)
    tmp_str = get_exe_code(m.submatches(0))
    content = re.replace(content, tmp_str)
    else
    exit do
    end if
    loop
    set m = nothing
    set ms = nothing
    re.pattern="^\s*="
    aspEnd=1
    aspStart=inStr(aspEnd,content,"<%")+2
    set re1=new RegExp
    re1.ignorecase = true
    re1.global = false
    re1.pattern = "response\.Write(.+)"
    do while aspStart>aspEnd+1
    execode = execode&vbcrlf&" hughchiu_rtcode = hughchiu_rtcode&"""&replace( replace(Mid(content,aspEnd,aspStart-aspEnd-2),"""",""""""), vbcrlf, """&vbcrlf&""")&""""&vbcrlf
    aspEnd=inStr(aspStart,content,"%\>")+2
    tmp_str = Mid(content,aspStart,aspEnd-aspStart-2)
    do
    set ms = re1.execute(tmp_str)
    if ms.count<>0 then
    set m = ms(0)
    tmp_str = re1.replace(tmp_str, " hughchiu_rtcode = hughchiu_rtcode&"&m.submatches(0))
    else
    exit do
    end if
    loop
    set m = nothing
    set ms = nothing
    execode = execode& re.replace(tmp_str,"hughchiu_rtcode = hughchiu_rtcode&")
    aspStart=inStr(aspEnd,content,"<%")+2
    loop
    set re1 = nothing
    set re=nothing
    execode = execode&vbcrlf&" hughchiu_rtcode = hughchiu_rtcode&"""&replace( replace(Mid(content,aspEnd), """", """"""), vbcrlf, """&vbcrlf&""" )&""""&vbcrlf
    get_exe_code = "<%"&execode&"%\>"
    End Function
    function asp2html(20041227111723.htm)
    dim code
    code = replace( replace( replace( get_exe_code(20041227111723.htm), "hughchiu_rtcode = hughchiu_rtcode&"""""&vbcrlf, "" ), "<%", "" ), "%\>", "" )
    'response.Write(code)
    execute(code)
    'response.Write( hughchiu_rtcode )
    asp2html = hughchiu_rtcode
    end function
    %>

返回列表
返回首頁 主站蜘蛛池模板: 日韩人妻无码精品无码中文字幕 | 囯产精品一品二区三区| 色在线免费视频| 国自产拍91大神精品| 一个人看的视频www在线| 日日操夜夜操视频| 久久综久久美利坚合众国| 欧美成人午夜片一一在线观看 | 女的被触手到爽羞羞漫画| 中文字幕永久在线视频| 日本道色综合久久影院| 亚洲av永久精品爱情岛论坛| 欧美日韩视频在线观看高清免费网站 | 人妻无码一区二区三区| 精品在线视频一区| 国产ww久久久久久久久久| 韩国理论片久久电影网| 国产波多野结衣中文在线播放| 97久久精品午夜一区二区| 天天碰免费上传视频| 一本大道在线无码一区| 抽搐一进一出gif日本| 久久久婷婷五月亚洲97号色| 日韩精品www| 亚洲av熟妇高潮30p| 欧美女人毛茸茸| 亚洲欧洲无卡二区视頻| 激情伊人五月天久久综合| 精东传媒国产app| 国产浮力影院在线地址| 真实男女动态无遮挡图| 国产麻豆va精品视频| 99精品久久久中文字幕| 天天狠狠弄夜夜狠狠躁·太爽了| 一区二区三区无码高清视频| 成人a毛片在线看免费全部播放| 中文字幕欧美视频| 无翼乌全彩之大雄医生| 久久久亚洲欧洲日产国码aⅴ| 日本黄页网站免费大全| 久久精品99久久香蕉国产|