扫一扫
关注微信公众号

测试url可用性的脚本
2005-12-16   邪恶八进制信息安全团队(www.eviloctal.com)

'========================================
' 测试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>

热词搜索:

上一篇:详解Windows帐户权限设置,搞定网络安全
下一篇:浅析Win 2000中的NTLM安全策略

分享到: 收藏