zoukankan      html  css  js  c++  java
  • 测试url可用性的脚本

    ======================================== ' 测试url可用性 TestUrl.vbe ' Used: cscript TestUrl.vbe url ' Code by haicao E.S.T '======================================== 'On Error Resume Next HELP() If Wscript.Arguments.Count <>1 Then Wscript.echo "参数有误!" Wscript.Quit end if strURL = wscript.arguments(0) Wscript.Echo("URL: " & strURL & " 页面状态:" &TestUrl(strURL)) '============================================================================== function TestUrl(byval strURL) on error resume next Set objHTTP = CreateObject("MSXML2.XMLHTTP") objHTTP.Open "GET", strURL, FALSE objHTTP.Send TestUrl=objHTTP.statusText end function sub HELP() WSCRIPT.ECHO "========================================" wscript.echo " 测试url可用性  TestUrl.vbe " wscript.echo " Used: cscript TestUrl.vbe url" wscript.echo " Code by haicao E.S.T" WSCRIPT.ECHO "========================================" end sub '============================================================================== <%strURL = request("url")%> <html><title>测试url可用性</title> <body> <form> <input name=url type=text value="<%=strURL%>"> <input name=check1 type=submit value="查询有效性"> </form> <% On Error Resume Next if strURL<>"" then Set objHTTP = CreateObject("MSXML2.XMLHTTP") objHTTP.Open "GET", strURL, FALSE objHTTP.Send if instr(objHTTP.statusText,"OK") then response.write "测试的url: " & strURL &" 有效!返回状态:" &objHTTP.statusText else response.write "测试的url: " & strURL &" 返回状态:" &objHTTP.statusText end if end if %> </body> </html>
  • 相关阅读:
    find 用法
    linux 查看链接库的版本
    虚函数重载(overwrite) 继承覆盖问题
    将iso mount 到nfs 目录问题
    centos 下使用 pytesseract 识别文字
    nginx 报错Malformed HTTP request line, git 报错fatal: git-write-tree: error building trees
    nfs 支持ipv6
    数位操作
    二分图(最小顶点覆盖 最大匹配 最大独立集 )
    欧几里得算法
  • 原文地址:https://www.cnblogs.com/adodo1/p/4327050.html
Copyright © 2011-2022 走看看