ASP Msxml2.ServerXMLHTTP.3.0 로 특정사이트 계속 체크하기


<% 'On Error Resume Next Dim HttpPath Dim XMLhttp HttpPath="http://www.site/XMLModule" '------------------------------------------------------------------- Dim lResolve Dim lConnect Dim lSend Dim lReceive Set XMLhttp = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0") '---낮은 버전 Set XMLhttp = Server.CreateObject("Msxml2.XMLHTTP")-- lResolve = 8 * 1000 'Timeout values are in milli-seconds lConnect = 8 * 1000 lSend = 10 * 1000 lReceive = 10 * 1000 XMLhttp.setTimeouts lResolve, lConnect, lSend, lReceive XMLhttp.open "POST",HttpPath, False '------------------------------------------------------------------ XMLhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" XMLhttp.Send "Type=1&Request=request001" 'On Error Resume Next를 반드시 넣어야 함 'Response.ContentType = "text/xml" 'Response.write "
" & XMLhttp.responseText

Dim sResponse
sResponse = XMLhttp.responseText

'-----------------------------------------------------------------------
Response.Write HttpPath
Response.Write "xmlSvr Server Status
"
Response.Write "-----------------------------------------"
Response.Write "Status (Value must be 200): " & XMLhttp.status
Response.Write "ReadyState (Value must be 4): " & XMLhttp.ReadyState
Response.Write "StatusText (Value must be OK): " & XMLhttp.StatusText
Response.Write "AllResponseHeaders:
" & XMLhttp.GetAllResponseHeaders
'-----------------------------------------------------------------------

Dim status

if Instr(sResponse,"IGNORED") then '특정문구 있는지 파악
status = "OK"
end if

response.write "
status:" & sResponse

if status="OK" then
response.write "
Site is OK"
end if

Set XMLhttp = Nothing
%>

비고 : 사이트 계속 체크 하기 위해 자바스크립트 삽입