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>
  • 相关阅读:
    springboot启动只显示图标不报错
    tmux常用
    ubuntu+anaconda+mxnet环境配置
    OpenCV学习笔记(二)
    c++基础
    c++算法实现(一)
    pytorch使用不完全文档
    ubuntu上传到百度网盘
    pickel加速caffe读图
    caffe常用
  • 原文地址:https://www.cnblogs.com/adodo1/p/4327773.html
Copyright © 2011-2022 走看看