方法有很多。 <% 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 %>
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