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.

145 lines
3.7 KiB

  1. <HTML>
  2. <HEAD>
  3. <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
  4. <TITLE></TITLE>
  5. </HEAD>
  6. <BODY topMargin=0>
  7. <P>&nbsp;</P>
  8. <P>&nbsp;</P>
  9. <P align=center><FONT face="Arial Black" size=5><STRONG>PCHealth Remote Control
  10. Unittest (Client)</STRONG></FONT></P>
  11. <TABLE>
  12. <TR>
  13. <TD><BUTTON id=connectButton name=connectButton onclick=ConnectButtonHandler()>Connect</BUTTON></TD>
  14. <TD></INPUT></TD>
  15. <TD><BUTTON id=disconnectButton name=disconnectButton onclick=DisconnectButtonHandler()>Disconnect</BUTTON></TD></TR>
  16. </TABLE>
  17. <TABLE border=0 cellPadding=0 cellSpacing=0 style="LEFT: 10px; TOP: 31px">
  18. <TBODY>
  19. <TR>
  20. <TD>
  21. <P>
  22. <OBJECT classid=clsid:299BE050-E83E-4DB7-A7DA-D86FDEBFE6D0
  23. data=data:application/x-oleobject;base64,UOCbKT7ot02n2thv3r/m0AADAAAlQgAAnDEAAA==
  24. height=480 id=ClientHost name=ClientHost
  25. style="BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; HEIGHT: 480px; WIDTH: 640px"
  26. width=640></OBJECT>
  27. </P>
  28. </TD>
  29. </TR>
  30. </TBODY>
  31. </TABLE>
  32. <P></P>
  33. <TABLE>
  34. <TR>
  35. <TD>
  36. </TD>
  37. </TR>
  38. </TABLE>
  39. <SCRIPT Language="JScript">
  40. var RemoteDesktopClientObj = null;
  41. var QryMgr = null;
  42. var FolderNodeId = 0;
  43. var RootDataCol = null;
  44. var ChannelManager = null;
  45. var ChatChannel = null;
  46. var tFileName = "\\\\pchealth\\public\\rc\\parms.txt";
  47. function ConnectedHandler() {
  48. alert("ClientHost_Connected");
  49. }
  50. function SendChatButtonHandler() {
  51. if (ChatChannel != null) {
  52. ChatChannel.SendChannelData(chatText.value);
  53. }
  54. }
  55. function DisconnectButtonHandler() {
  56. if (RemoteDesktopClientObj != null) {
  57. RemoteDesktopClientObj.DisconnectFromServer();
  58. }
  59. }
  60. function RemoteControlButtonHandler() {
  61. if (RemoteDesktopClientObj != null) {
  62. RemoteDesktopClientObj.ConnectRemoteDesktop();
  63. }
  64. }
  65. function RemoteControlEndButtonHandler() {
  66. if (RemoteDesktopClientObj != null) {
  67. RemoteDesktopClientObj.DisconnectRemoteDesktop();
  68. }
  69. }
  70. function DisconnectedHandler(reason) {
  71. alert("ClientHost_Disconnected");
  72. }
  73. function RemoteControlRequestCompleteHandler(status) {
  74. alert("ClientHost_RemoteControlRequestComplete");
  75. }
  76. function ChannelDataReadyHandler(channelID) {
  77. var str;
  78. str = ChatChannel.ReceiveChannelData();
  79. incomingChatText.value = incomingChatText.value + "\n" + str;
  80. }
  81. function ConnectButtonHandler() {
  82. try {
  83. RemoteDesktopClientObj = ClientHost.GetRemoteDesktopClient();
  84. // Bind the event handlers for this object.
  85. RemoteDesktopClientObj.OnConnected = function()
  86. { ConnectedHandler(); }
  87. RemoteDesktopClientObj.OnDisconnected = function(reason)
  88. { DisconnectedHandler(reason); }
  89. RemoteDesktopClientObj.OnConnectRemoteDesktopComplete = function(status)
  90. { RemoteControlRequestCompleteHandler(status); }
  91. // Add the 'chat' channel.
  92. ChannelManager = RemoteDesktopClientObj.ChannelManager;
  93. if (ChatChannel == null) {
  94. ChatChannel = ChannelManager.OpenDataChannel("70");
  95. ChatChannel.OnChannelDataReady = function()
  96. { ChannelDataReadyHandler(); }
  97. }
  98. //
  99. // Read Connection Parms
  100. //
  101. var fso = new ActiveXObject("Scripting.FileSystemObject");
  102. var ForReading = 1, ForWriting = 2, ForAppending = 8;
  103. var TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0;
  104. var file = fso.GetFile(tFileName);
  105. var fileHandle = file.OpenAsTextStream(ForReading,TristateUseDefault);
  106. var s = fileHandle.ReadLine();
  107. RemoteDesktopClientObj.ConnectParms = s;
  108. RemoteDesktopClientObj.ConnectToServer("");
  109. fileHandle.Close();
  110. } catch (e) {
  111. alert(e.Description);
  112. }
  113. }
  114. </SCRIPT>
  115. </BODY>
  116. </HTML>