熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

asp生成html簡單實現程序

2013-11-13 10:39:05  來源: .NET編程 

  代碼如下

  Function getHttpXML()

  Set Http = ServerCreateObject("MsxmlServerXMLHTTP")

  dim lResolvelConnectlSendlReceive

  lResolve = *

  lConnect = *

  lSend = *

  lReceive = *

  HttpsetTimeouts lResolvelConnectlSendlReceive

  Httpopen "POST""false 抓取需要生成html的頁面

  HttpSend()

  if Httpreadystate = then str=timer()

  if Httpreadystate = then str=timer()

  if Httpreadystate <> then

  exit Function

  end if

  if Httpreadystate = then str=timer()

  getHttpXML=BytesToBstr(HttpresponseBody"utf")

  getHttpXML=HttpresponseBody

  getHttpXML=FormatNumber((strstr)/)

  if errNumber<> then errClear

  End Function

  生成文件

  Function SaveToFile()

  Dim objStream

  On Error Resume Next

  Set objStream = ServerCreateObject("ADODBStream")

  If ErrNumber= Then

  ResponseWrite "

  非常遺憾您的主機不支持ADODBStream不能使用本程序

  "

  ErrClear

  ResponseEnd

  End If

  With objStream

  Type =

  Open

  Charset = "utf"

  write getHttpXML

  SaveToFile ServerMapPath("indexhtml")

  Close

  End With

  Set objStream = Nothing

  End Function

  call SaveToFile()


From:http://tw.wingwit.com/Article/program/net/201311/14224.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.