国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > HTML > 正文

asp生成html簡單實現(xiàn)程序

2020-03-24 15:58:02
字體:
供稿:網(wǎng)友

  代碼如下

  Function getHttpXML()

  Set Http = Server.CreateObject("Msxml2.ServerXMLHTTP")

  dim lResolve,lConnect,lSend,lReceive

  lResolve = 5*1000

  lConnect = 5*1000

  lSend = 15*1000

  lReceive = 15*1000

  Http.setTimeouts lResolve,lConnect,lSend,lReceive

  Http.open "POST","http://www.3lian.com/",false '抓取需要生成html的頁面

  Http.Send()

  if Http.readystate =1 then str1=timer()

  if Http.readystate =4 then str2=timer()

  if Http.readystate <> 4 then

  exit Function

  end if

  'if Http.readystate =0 then str1=timer()

  'getHttpXML=BytesToBstr(Http.responseBody,"utf-8")

  getHttpXML=Http.responseBody

  'getHttpXML=FormatNumber((str2-str1)/1000,3)

  if err.Number<>0 then err.Clear

  End Function

  '生成文件

  Function SaveToFile()

  Dim objStream

  On Error Resume Next

  Set objStream = Server.CreateObject("ADODB.Stream")

  If Err.Number=-2147221005 Then

  Response.Write "

  非常遺憾,您的主機不支持ADODB.Stream,不能使用本程序

  "

  Err.Clear

  Response.End

  End If

  With objStream

  .Type = 1

  .Open

  .Charset = "utf-8"

  .write getHttpXML

  .SaveToFile Server.MapPath("index.html"),2

  .Close

  End With

  Set objStream = Nothing

  End Function

  call SaveToFile()

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 侯马市| 深水埗区| 英山县| 西乡县| 都匀市| 来凤县| 高邑县| 天祝| 东明县| 昆明市| 平果县| 彩票| 成都市| 吴堡县| 南开区| 平阴县| 台南县| 满城县| 余姚市| 鹰潭市| 株洲县| 革吉县| 阿尔山市| 韶山市| 内乡县| 济阳县| 育儿| 禄劝| 瑞金市| 合阳县| 康定县| 济南市| 略阳县| 枞阳县| 桃园县| 高邮市| 新郑市| 南平市| 卢氏县| 舞钢市| 溆浦县|