04. august 2002 - 20:08
#5
Det er nu kun mig, der snakker :o)
Hvis du bare udskifter rs("Link") og rs("ID") med dine egen navne på kolonnerne, burde det virke:
***************************************************************
<%
' Array med URL'er, som skal chekkes
Do While Not rs.EOF
arrURLS = arrURLS & "," & rs("Link")
arrIDS = arrIDS & "," & rs("ID")
rs.MoveNext
Loop
arrURLS = Split(arrURLS,",")
arrIDS = Split(arrIDS,",")
' Array med HTTP header koder
arrHTTPcode = Array("100", "101", "200", "201", "202", "203", "204", "205", "206", "300", "301", "302", "303", "304", "305", "307", "400", "401", "402", "403", "404", "405", "406", "407", "408", "409", "410", "411", "412", "413", "414", "415", "416", "417", "500", "501", "502", "503", "504", "505")
' Array med HTTP header kodernes forklaringer
arrHTTPtext = Array("Continue", "Switching Protocols", "OK", "Created", "Accepted", "Non-Authoritative Information", "No Content", "Reset Content", "Partial Content", "Multiple Choices", "Moved Permanently", "Found", "See Other", "Not Modified", "Use Proxy", "Temporary Redirect", "Bad Request", "Unauthorized", "Payment Required", "Forbidden", "Not Found", "Method Not Allowed", "Not Acceptable", "Proxy Authentication Required", "Request Time-out", "Conflict", "Gone", "Length Required", "Precondition Failed", "Request Entity Too Large", "Request-URI Too Large", "Unsupported Media Type", "Requested range not satisfiable", "Expectation Failed", "Internal Server Error", "Not Implemented", "Bad Gateway", "Service Unavailable", "Gateway Time-out", "HTTP Version not supported")
' Gennemløb Array med URL'er
For intURL = 0 to Ubound(arrURLS)
Set HttpObj = Server.CreateObject("AspHTTP.Conn")
HTTPObj.Url = arrURLS(intURL)
HTTPObj.GetURL
For intCode = 0 to Ubound(arrHTTPcode)
If Instr(HttpObj.Response,arrHTTPcode(intCode)) Then
strResponse = arrHTTPtext(intCode)
Exit For
End if
Next
If strResponse <> "OK" Then
Response.Write "<p>" & arrIDS(intURL) & " - " & arrURLS(intURL) & " - " & strResponse & "</p>"
End If
strResponse = ""
Next
%>