zoukankan      html  css  js  c++  java
  • 使用SQL定时触发VBSCRIPT脚本发送HTTP请求

    test.vbs文件代码如下图:

     1  ScriptTimeout = 120
     2  function getHTTPPage(url) 
     3   on error resume next 
     4   dim http 
     5   set http=CreateObject("Microsoft.XMLHTTP") 
     6   Http.open "GET",url,false 
     7   Http.send() 
     8   if Http.readystate<>4 then
     9    exit function 
    10   end if 
    11   getHTTPPage=bytes2BSTR(Http.responseBody) 
    12   set http=nothing
    13   if err.number<>0 then err.Clear  
    14  end function
    15 
    16  Function bytes2BSTR(vIn) 
    17   dim strReturn 
    18   dim i1,ThisCharCode,NextCharCode 
    19   strReturn = "" 
    20   For i1 = 1 To LenB(vIn) 
    21    ThisCharCode = AscB(MidB(vIn,i1,1)) 
    22    If ThisCharCode < &H80 Then 
    23     strReturn = strReturn & Chr(ThisCharCode) 
    24    Else 
    25     NextCharCode = AscB(MidB(vIn,i1+1,1)) 
    26     strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode)) 
    27     i1 = i1 + 1 
    28    End If 
    29   Next 
    30   bytes2BSTR = strReturn 
    31  End Function 
    32  
    33  Function GetMid(txt,StrOne,StrTwo)
    34  NumOne = Instr(txt,StrOne)
    35  NumTwo = Instr(txt,StrTwo)
    36  if NumOne=0 or NumTwo=0 Then GetMid="":Exit Function
    37  GetMid = Mid(txt,NumOne+Len(StrOne),NumTwo-NumOne-Len(StrOne))
    38  End Function
    39  
    40  Dim htmSource
    41  htmSource=getHTTPPage("http://localhost/test/absa.asp")
    View Code
  • 相关阅读:
    iOS电商类App研发学习总结
    Swift4.0复习闭包
    Swift4.0复习函数
    Swift4.0复习Optional
    SQL面试题
    sql(join on 和where的执行顺序)
    算法四:回溯和分支界定
    算法三:贪婪算法
    编程之美2.11:寻找最近的点对
    编程之美2.5:寻找最大的K个数
  • 原文地址:https://www.cnblogs.com/webczw/p/3366430.html
Copyright © 2011-2022 走看看