行業(yè)動態(tài)
asp生成html代碼、asp生成html單頁功能代碼
發(fā)布日期:2012-11-12 閱讀次數(shù):3426 字體大?。?a href="javascript:;" onclick="ChangeFontSize('content',16)">大
ASP/Visual Basic代碼
  1. <%   
  2. Set xml = Server.CreateObject("Microsoft.XMLHTTP")   
  3. '易天科技提示您把下面的地址替換成你的首頁的文件地址,一定要用http://開頭的絕對路徑,不能寫相對路徑哦  
  4. xml.Open "GET""http://www.002bubu.com/yiskyindex.asp"False  
  5. xml.Send   
  6. BodyText=xml.ResponseBody   
  7. BodyText=BytesToBstr(BodyText,"gb2312")   
  8. Set xml = Nothing  
  9. Dim fso, MyFile   
  10. Set fso = CreateObject("Scripting.FileSystemObject")   
  11. Set MyFile= fso.CreateTextFile(server.MapPath("index.html"), True)   
  12. MyFile.WriteLine(BodyText)   
  13. MyFile.Close   
  14. Response.Write ( "易天科技www.002bubu.com 提示您,成功生成文件:index.html" )  
  15.  
  16. '定義BytesToBstr函數(shù) 
  17. Function BytesToBstr(body,Cset)   
  18. dim objstream   
  19. set objstream = Server.CreateObject("adodb.stream")   
  20. objstream.Type = 1   
  21. objstream.Mode =3   
  22. objstream.Open   
  23. objstream.Write body   
  24. objstream.Position = 0   
  25. objstream.Type = 2   
  26. objstream.Charset = Cset   
  27. BytesToBstr = objstream.ReadText   
  28. objstream.Close   
  29. set objstream = nothing   
  30. End Function  
  31.   
  32. %>