Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

183 lines
4.7 KiB

  1. <HTML>
  2. <HEAD>
  3. <META NAME="GENERATOR" Content="Microsoft Developer Studio">
  4. <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
  5. <OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
  6. <TITLE>Connection Test</TITLE>
  7. </HEAD>
  8. <BODY>
  9. <SCRIPT LANGUAGE=javascript>
  10. <!--
  11. var g_cn;
  12. function Common_ClearTable( tbl )
  13. {
  14. if(tbl == null) return;
  15. var i;
  16. var lCount = tbl.rows.length;
  17. for(i=0; i<lCount; i++)
  18. {
  19. tbl.deleteRow(0);
  20. }
  21. }
  22. function Common_UnescapeURL( url )
  23. {
  24. return unescape( url.replace( /\+/g , " " ) );
  25. }
  26. function Common_EscapeHTMLTag( str )
  27. {
  28. str = str.replace( /&/g , "&amp;" );
  29. str = str.replace( /\"/g, "&quot;" ); // "
  30. str = str.replace( /</g , "&lt;" );
  31. str = str.replace( />/g , "&gt;" );
  32. return str;
  33. }
  34. function Common_AddQuotes( str )
  35. {
  36. return '"' + str.replace( /\"/g, "&quot;" ) + '"'; // '
  37. }
  38. function cn_onCheckDone( cn, lStatus, hr, url, vCtx )
  39. {
  40. var tblTaxonomy = document.all.TaxonomyTable;
  41. var elemRow;
  42. elemRow = tblTaxonomy.rows[vCtx];
  43. if(lStatus == 1)
  44. {
  45. elemRow.cells[1].innerHTML = "***";
  46. elemRow.cells[1].style.background = "green"
  47. }
  48. if(lStatus == 2)
  49. {
  50. elemRow.cells[1].innerHTML = "---";
  51. elemRow.cells[1].style.background = "red"
  52. }
  53. if(lStatus == 3)
  54. {
  55. elemRow.cells[1].innerHTML = "???";
  56. elemRow.cells[1].style.background = "yellow"
  57. }
  58. Print( "onCheckDone " + url + " Status : " + lStatus + " lIndex : " + vCtx );
  59. Print( "Change = " + cn.Status );
  60. }
  61. function cn_onStatusChange( cn, lStatus )
  62. {
  63. Print( "onStatusChange " + lStatus );
  64. }
  65. function Print( line )
  66. {
  67. out.innerHTML = out.innerHTML + line + "<BR>";
  68. }
  69. function button_exec()
  70. {
  71. var strArray = new Array( "http://www.microsoft.com" ,
  72. "http://www.junkmicrosoft.com" ,
  73. "hcp://system/test5_connection.htm" ,
  74. "hcp://system/homepage.htm" ,
  75. "ftp://ftp.test.org" ,
  76. "ms-its:C:\\WINNT\\Help\\Gstart.chm::/getting_started_with_Windows_2000_server.htm",
  77. "http://www.cnn.com" ,
  78. "http://www.junkmicrosoft.com" ,
  79. "ms-its:C:\\WINNT\\Help\\Gstart.chm::/getting_started_with_Windows_2000_pro.htm" );
  80. var numArray = strArray.length;
  81. var tblTaxonomy = document.all.TaxonomyTable;
  82. var elemRow;
  83. var elemCell;
  84. var strInnerHTML;
  85. //
  86. // Clear stuff
  87. //
  88. Common_ClearTable( tblTaxonomy );
  89. out.innerHTML = "";
  90. g_cn = pchealth.Connectivity.CreateObject_ConnectionCheck();
  91. g_cn.onCheckDone = cn_onCheckDone;
  92. g_cn.onStatusChange = cn_onStatusChange;
  93. if(pchealth.NetworkAlive())
  94. {
  95. Print('Network Alive');
  96. }
  97. else
  98. {
  99. Print('Network not alive');
  100. }
  101. for( i = 0 ; i < numArray ; i++ )
  102. {
  103. elemRow = tblTaxonomy.insertRow();
  104. elemCell = elemRow.insertCell(0);
  105. elemCell.style.width = "200px";
  106. elemCell.innerHTML = "URL-" + (i+1) ;
  107. elemCell = elemRow.insertCell(1);
  108. elemCell.style.width = "25px";
  109. elemCell.style.background = "gray"
  110. elemCell.innerHTML = "---";
  111. elemCell = elemRow.insertCell(2);
  112. elemCell.style.width = "100%";
  113. strInnerHTML = "<A tabIndex=300 href=" + Common_AddQuotes( strArray[i]);
  114. strInnerHTML += " >";
  115. strInnerHTML += Common_EscapeHTMLTag( strArray[i] );
  116. strInnerHTML += "</A>";
  117. elemCell.innerHTML = strInnerHTML ;
  118. g_cn.StartUrlCheck( strArray[i], i );
  119. }
  120. }
  121. function button_abort()
  122. {
  123. if(g_cn != null)
  124. {
  125. g_cn.Abort();
  126. Print("Aborted");
  127. }
  128. }
  129. function Print( line )
  130. {
  131. out.innerHTML = out.innerHTML + line + "<BR>";
  132. }
  133. //-->
  134. </SCRIPT>
  135. <INPUT type="button" value="Start" onClick="button_exec();">&nbsp;
  136. <INPUT type="button" value="Abort" onClick="button_abort();"><P>
  137. <TABLE BORDER=1 WIDTH="100%" ID="TaxonomyTable">
  138. <TBODY>
  139. </TBODY>
  140. </TABLE>
  141. <DIV ID=out></DIV>
  142. </BODY>
  143. </HTML>