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.

152 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>
  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. </TBODY>
  33. </TABLE>
  34. <HR>
  35. <TABLE>
  36. <TR>
  37. <TD><INPUT id=incomingChatText name=incomingChatText height="150" style="HEIGHT: 150px; WIDTH: 275px" width="275"
  38. ></INPUT></TD>
  39. </TR>
  40. <TR>
  41. <TD><INPUT id=chatText name=chatText style="WIDTH: 275px" width="275" ></INPUT></TD>
  42. <TD><BUTTON id=sendChatButton name=sendChatButton onclick=SendChatButtonHandler()>Send</BUTTON></TD>
  43. </TR>
  44. </TABLE>
  45. <SCRIPT Language="JScript">
  46. var RDSHost = null;
  47. var RemoteDesktopSession = null;
  48. var ChannelManager = null;
  49. var ChatChannel = null;
  50. function UpdateConnectParms() {
  51. if (RemoteDesktopSession != null) {
  52. var str;
  53. str = RemoteDesktopSession.ConnectParms;
  54. connectParms.value = str;
  55. }
  56. }
  57. function CreateNewSession() {
  58. if (RemoteDesktopSession != null)
  59. {
  60. alert("Must close existing session first.");
  61. return;
  62. }
  63. RDSHost = new ActiveXObject("RDSHost.SAFRemoteDesktopServerHost.1");
  64. RemoteDesktopSession = RDSHost.CreateRemoteDesktopSession(4, false, 0, "");
  65. var x;
  66. ChannelManager = RemoteDesktopSession.ChannelManager;
  67. ChatChannel = ChannelManager.OpenDataChannel("70");
  68. ChatChannel.OnChannelDataReady = function()
  69. { OnChannelDataReadyEvent(); }
  70. // Bind events.
  71. RemoteDesktopSession.OnConnected = function()
  72. { OnClientConnected(); }
  73. RemoteDesktopSession.OnDisconnected = function()
  74. { OnClientDisconnected(); }
  75. }
  76. function OpenExistingSession() {
  77. if (RemoteDesktopSession != null)
  78. {
  79. alert("Must close existing session first.");
  80. return;
  81. }
  82. RDSHost = new ActiveXObject("RDSHost.SAFRemoteDesktopServerHost.1");
  83. RemoteDesktopSession = RDSHost.OpenRemoteDesktopSession(existingParms.value);
  84. var x;
  85. ChannelManager = RemoteDesktopSession.ChannelManager;
  86. ChatChannel = ChannelManager.OpenDataChannel("70");
  87. ChatChannel.OnChannelDataReady = function()
  88. { OnChannelDataReadyEvent(); }
  89. // Bind events.
  90. RemoteDesktopSession.OnConnected = function()
  91. { OnClientConnected(); }
  92. RemoteDesktopSession.OnDisconnected = function()
  93. { OnClientDisconnected(); }
  94. }
  95. function CloseSession() {
  96. if (RemoteDesktopSession != null) {
  97. RDSHost.CloseRemoteDesktopSession(RemoteDesktopSession);
  98. RemoteDesktopSession = null;
  99. }
  100. }
  101. function DisconnectSession() {
  102. if (RemoteDesktopSession != null) {
  103. RemoteDesktopSession.Disconnect();
  104. }
  105. }
  106. function SendChatButtonHandler() {
  107. if (ChatChannel != null) {
  108. ChatChannel.SendChannelData(chatText.value);
  109. }
  110. }
  111. function OnChannelDataReadyEvent(channelName) {
  112. var str;
  113. str = ChatChannel.ReceiveChannelData()
  114. incomingChatText.value = incomingChatText.value + "\n" + str;
  115. }
  116. function OnClientConnected() {
  117. alert("Client connected.");
  118. }
  119. function OnClientDisconnected() {
  120. alert("Client disconnected.");
  121. }
  122. </SCRIPT>
  123. </BODY>
  124. </HTML>