1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

asp怎样生成html???

本帖由 xieguanwen2005-12-17 发布。版面名称:前端开发

  1. xieguanwen

    xieguanwen New Member

    注册:
    2005-12-05
    帖子:
    2
    赞:
    0
    我不知道做呀,
    能不告诉我呀?
     
  2. Kevin

    Kevin New Member

    注册:
    2005-10-23
    帖子:
    12,728
    赞:
    55
    晕,这问题~~~
    楼下来~~
     
  3. kuhanzhu

    kuhanzhu New Member

    注册:
    2005-12-10
    帖子:
    17
    赞:
    0
    方法有很多。
    <%
    filename="index.html"
    function ichange(str)
    finalstr = ""
    for i = 1 to lenb(str)
    icharcode = ascb(midb(str,i,1))
    if icharcode < &H80 then
    finalstr = finalstr & chr(icharcode)
    else
    inextcode = ascb(midb(str,i+1,1))
    finalstr = finalstr & chr(clng(icharcode) * &H100 + cint(inextcode))
    i = i + 1
    end if
    next
    ichange = finalstr
    end function


    'Url="http://";&Request.ServerVariables("blog/index1.asp")
    url="http://kuhanzhu.512j.com"
    set iconnect = createobject("Microsoft.XMLHTTP")
    Html = iconnect.open ("GET",url,false)
    iconnect.send()
    Html = ichange(iconnect.responsebody)
    if html<>"" then
    Set fso = Server.CreateObject("Scripting.FileSystemObject")
    Set fout = fso.CreateTextFile(server.mappath(""&filename&""))
    fout.Write html
    fout.close
    set fout=nothing
    set fso=nothing
    response.write"生成 "&url&" 成功!"
    else
    response.write"模版丢失!"
    end if
    %>
     
  4. jim.ma

    jim.ma New Member

    注册:
    2005-10-01
    帖子:
    7
    赞:
    0
    function Save2File(aPath, aStr)
    dim myfso,myfile
    Set myfso = Server.CreateObject("Scripting.FileSystemObject")
    Set myFile = myfso.CreateTextFile(aPath,True)
    myFile.WriteLine aStr
    myFile.close
    set myfso=nothing
    end function