asp下的一個檢測鏈接是否正常的函數(shù)
更新時間:2008年07月15日 19:26:25 作者:
很簡單的函數(shù),用來檢測網(wǎng)站域名是否能正常訪問。
Function urlChk(sUrl)
on error resume next
Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlHttp.open "GET",sUrl,false
xmlHttp.send
if xmlHttp.Status <> 200 then
urlChk=false
else
urlChk=true
end if
End Function
sUrl="http://www.dbjr.com.cn"
if urlChk(sUrl) then
response.write(sUrl&"(可以正常訪問)")
else
response.write(sUrl&"(訪問不了)")
end if
on error resume next
Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlHttp.open "GET",sUrl,false
xmlHttp.send
if xmlHttp.Status <> 200 then
urlChk=false
else
urlChk=true
end if
End Function
sUrl="http://www.dbjr.com.cn"
if urlChk(sUrl) then
response.write(sUrl&"(可以正常訪問)")
else
response.write(sUrl&"(訪問不了)")
end if
相關(guān)文章
關(guān)于靜態(tài)頁生成問題 突破form數(shù)量限制
關(guān)于靜態(tài)頁生成問題 突破form數(shù)量限制...2006-09-09用存儲過程、GetRows()、抽取10萬條數(shù)據(jù)的速度測試
用存儲過程、GetRows()、抽取10萬條數(shù)據(jù)的速度測試...2007-03-03ASP中DateAdd函數(shù)中日期相加或相減使用方法
本文將介紹ASP中DateAdd函數(shù)中日期相加或相減使用方法,需要了解的朋友可以參考下2012-12-12完美解決PJ的Cookies保存時限問題!可選擇記錄登陸時長!
完美解決PJ的Cookies保存時限問題!可選擇記錄登陸時長!...2007-02-02