1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
<% 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" 'Test 'Response.write "<br/>" & XMLhttp.responseText Dim sResponse sResponse = XMLhttp.responseText '----------------------------------------------------------------------- Response.Write HttpPath Response.Write "<b>xmlSvr Server Status</b><br/>" Response.Write "-----------------------------------------" Response.Write "<b>Status (Value must be 200): </b>" & XMLhttp.status Response.Write "<b>ReadyState (Value must be 4): </b>" & XMLhttp.ReadyState Response.Write "<b>StatusText (Value must be OK): </b>" & XMLhttp.StatusText Response.Write "<b>AllResponseHeaders:</b><br/>" & XMLhttp.GetAllResponseHeaders '----------------------------------------------------------------------- Dim status if Instr(sResponse,"IGNORED") then '특정문구 있는지 파악 status = "OK" end if response.write "<br/>status:" & sResponse if status="OK" then response.write "<br/><b>Site is OK</b>" end if Set XMLhttp = Nothing %> 비고 : 사이트 계속 체크 하기 위해 자바스크립트 삽입 <script> function re(){ location.reload(); } tid=setTimeout(re,600000); //10분마다 체크 </script> |