Source code of Windows XP (NT5)
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.

178 lines
4.4 KiB

  1. <HTML>
  2. <HEAD>
  3. <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
  4. <TITLE></TITLE>
  5. </HEAD>
  6. <BODY>
  7. <TABLE>
  8. <TBODY>
  9. <TR>
  10. <TD><BUTTON id=CreateNewSession name=CreateNewSession onclick=CreateNewSession()>Create Session</BUTTON></TD>
  11. <TD><BUTTON id=CloseSession name=CloseSession onclick=CloseSession()>Close Session</BUTTON></TD>
  12. <TD><BUTTON id=DisconnectSession name=DisconnectSession onclick=DisconnectSession()>Disconnect Active Session</BUTTON></TD>
  13. </TR>
  14. </TBODY>
  15. </TABLE>
  16. <HR>
  17. <TABLE>
  18. <TBODY>
  19. <TR>
  20. <TD><BUTTON id=OpenExistingSession name=OpenExistingSession onclick=OpenExistingSession()>Open Existing Session</BUTTON></TD>
  21. <TD><INPUT id=existingParms name=existingParms style="HEIGHT: 22px; WIDTH: 521px"></INPUT></TD>
  22. </TR>
  23. </TBODY>
  24. </TABLE>
  25. <HR>
  26. <TABLE>
  27. <TBODY>
  28. <TR>
  29. <TD><BUTTON id=updateConnectParms name=updateConnectParms onclick=UpdateConnectParms()>Update Connect Parms</BUTTON></TD>
  30. <TD><INPUT id=connectParms name=connectParms style="HEIGHT: 22px; WIDTH: 521px"></INPUT></TD>
  31. </TR>
  32. <TR>
  33. <TD><BUTTON id=ConnectExpert name=ConnectExpert onclick=ConnectExpertHandler()>Connect Expert</BUTTON></TD>
  34. <TD><INPUT id=expertParms name=expertParms style="HEIGHT: 22px; WIDTH: 521px"></INPUT></TD>
  35. </TR>
  36. </TBODY>
  37. </TABLE>
  38. <HR>
  39. <TABLE>
  40. <TR>
  41. <TD><INPUT id=incomingChatText name=incomingChatText height="150" style="HEIGHT: 150px; WIDTH: 275px" width="275"
  42. ></INPUT></TD>
  43. </TR>
  44. <TR>
  45. <TD><INPUT id=chatText name=chatText style="WIDTH: 275px" width="275" ></INPUT></TD>
  46. <TD><BUTTON id=sendChatButton name=sendChatButton onclick=SendChatButtonHandler()>Send</BUTTON></TD>
  47. </TR>
  48. </TABLE>
  49. <SCRIPT Language="JScript">
  50. var RDSHost = null;
  51. var RemoteDesktopSession = null;
  52. var ChannelManager = null;
  53. var ChatChannel = null;
  54. var SafErrorCode = 0;
  55. function ConnectExpertHandler() {
  56. if( RDSHost == null ) {
  57. alert("You need to create a help session first");
  58. }
  59. else if( RemoteDesktopSession == null) {
  60. alert("Help session is not created.");
  61. }
  62. else {
  63. if( expertParms.value == "" ) {
  64. alert("No expert connect parm.");
  65. }
  66. else {
  67. SafErrorCode = RDSHost.ConnectToExpert(expertParms.value, 0);
  68. alert( "ConnectToExpert return " + SafErrorCode );
  69. }
  70. }
  71. }
  72. function UpdateConnectParms() {
  73. if (RemoteDesktopSession != null) {
  74. var str;
  75. str = RemoteDesktopSession.ConnectParms;
  76. connectParms.value = str;
  77. }
  78. }
  79. function CreateNewSession() {
  80. if (RemoteDesktopSession != null)
  81. {
  82. alert("Must close existing session first.");
  83. return;
  84. }
  85. RDSHost = new ActiveXObject("RDSHost.SAFRemoteDesktopServerHost.1");
  86. RemoteDesktopSession = RDSHost.CreateRemoteDesktopSession(4, false, 0, "");
  87. var x;
  88. ChannelManager = RemoteDesktopSession.ChannelManager;
  89. ChatChannel = ChannelManager.OpenDataChannel("70");
  90. ChatChannel.OnChannelDataReady = function()
  91. { OnChannelDataReadyEvent(); }
  92. // Bind events.
  93. RemoteDesktopSession.OnConnected = function()
  94. { OnClientConnected(); }
  95. RemoteDesktopSession.OnDisconnected = function()
  96. { OnClientDisconnected(); }
  97. }
  98. function OpenExistingSession() {
  99. if (RemoteDesktopSession != null)
  100. {
  101. alert("Must close existing session first.");
  102. return;
  103. }
  104. RDSHost = new ActiveXObject("RDSHost.SAFRemoteDesktopServerHost.1");
  105. RemoteDesktopSession = RDSHost.OpenRemoteDesktopSession(existingParms.value);
  106. var x;
  107. ChannelManager = RemoteDesktopSession.ChannelManager;
  108. ChatChannel = ChannelManager.OpenDataChannel("70");
  109. ChatChannel.OnChannelDataReady = function()
  110. { OnChannelDataReadyEvent(); }
  111. // Bind events.
  112. RemoteDesktopSession.OnConnected = function()
  113. { OnClientConnected(); }
  114. RemoteDesktopSession.OnDisconnected = function()
  115. { OnClientDisconnected(); }
  116. }
  117. function CloseSession() {
  118. if (RemoteDesktopSession != null) {
  119. RDSHost.CloseRemoteDesktopSession(RemoteDesktopSession);
  120. RemoteDesktopSession = null;
  121. }
  122. }
  123. function DisconnectSession() {
  124. if (RemoteDesktopSession != null) {
  125. RemoteDesktopSession.Disconnect();
  126. }
  127. }
  128. function SendChatButtonHandler() {
  129. if (ChatChannel != null) {
  130. ChatChannel.SendChannelData(chatText.value);
  131. }
  132. }
  133. function OnChannelDataReadyEvent(channelName) {
  134. var str;
  135. str = ChatChannel.ReceiveChannelData()
  136. incomingChatText.value = incomingChatText.value + "\n" + str;
  137. }
  138. function OnClientConnected() {
  139. alert("Client connected.");
  140. }
  141. function OnClientDisconnected() {
  142. alert("Client disconnected.");
  143. }
  144. </SCRIPT>
  145. </BODY>
  146. </HTML>