asp生成html文件代码

    技术2022-05-11  53

    <% on error resume next            Const adTypeBinary = 1Const adTypeText = 2Function Bytes2bStr(vin)Dim BytesStream,StringReturnSet BytesStream = Server.CreateObject("ADODB.Stream")With BytesStream.Type = adTypeText.Open.WriteText vin

    .Position = 0.Charset = "GB2312".Position = 2StringReturn = .ReadText.closeEnd WithSet BytesStream = Nothing

    Bytes2bStr = StringReturn

    End Function

    Url = ""&nameurl&"/"&admin&"/Get_Html_Index.asp"   '生成哪个页的代码set oSend=createobject("Microsoft.XMLHTTP")SourceCode = oSend.open ("GET",url,false) oSend.send()if err.number<>0 thenResponse.write err.descriptionResponse.End()end if  SourceCode = bytes2BSTR(oSend.responseBody)%><%Set fso = Server.CreateObject("Scripting.FileSystemObject")Set fout = fso.CreateTextFile(server.mappath("../Html/index.htm"))   '这里是生成文件保存的地址与文件名fout.Write SourceCodefout.closeset fout=nothingset fso=nothingresponse.write "生成 首页 文件名:Index.htm成功!<a href=../Html/Index.htm target=_blank><font color=#FF0000>点击这里查看</font></a>"%>


    最新回复(0)