windows-nt/Source/XPSP1/NT/termsrv/remdsk/unittest/client/salemclient.htm
2020-09-26 16:20:57 +08:00

217 lines
8.6 KiB
HTML

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY topMargin=0>
<TABLE>
<TR>
<TD><BUTTON id=connectButton name=connectButton onclick=ConnectButtonHandler()>Connect</BUTTON></TD>
<TD><INPUT id=parmsInput name=parmsInput
style="WIDTH: 400px" width="400"></INPUT></TD>
<TD><BUTTON id=disconnectButton name=disconnectButton onclick=DisconnectButtonHandler()>Disconnect</BUTTON></TD></TR>
</TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD>
<P>
<OBJECT classid=clsid:299BE050-E83E-4DB7-A7DA-D86FDEBFE6D0
data=data:application/x-oleobject;base64,UOCbKT7ot02n2thv3r/m0AADAAAlQgAAnDEAAA==
height=480 id=ClientHost name=ClientHost
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"
width=640></OBJECT>
</P>
</TD>
</TR>
</TBODY>
</TABLE>
<P></P>
<BUTTON id=remoteControlButton name=RemoteControlButton onclick=RemoteControlButtonHandler()>Remote Control</BUTTON>
<BUTTON id=stopRemoteControlButton name=stopRemoteControlButton onclick=RemoteControlEndButtonHandler()>Stop Remote Control</BUTTON>
<TABLE>
<TR>
<TD>
<TABLE>
<TR>
<TD><INPUT id=incomingChatText name=incomingChatText height="150" style="HEIGHT: 150px; WIDTH: 275px" width="275"
></INPUT></TD>
</TR>
<TR>
<TD><INPUT id=chatText name=chatText style="WIDTH: 275px" width="275" ></INPUT></TD>
<TD><BUTTON id=sendChatButton name=sendChatButton onclick=SendChatButtonHandler()>Send</BUTTON></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<SCRIPT Language="JScript">
var RemoteDesktopClientObj = null;
var QryMgr = null;
var FolderNodeId = 0;
var RootDataCol = null;
var ChannelManager = null;
var ChatChannel = null;
var Server = null;
var Port = null;
function ConnectedHandler() {
Server = RemoteDesktopClientObj.ConnectedServer;
Port = RemoteDesktopClientObj.ConnectedPort;
alert("ClientHost_Connected " + Server + " " + Port);
}
function SendChatButtonHandler() {
if (ChatChannel != null) {
ChatChannel.SendChannelData(chatText.value);
}
}
function DisconnectButtonHandler() {
if (RemoteDesktopClientObj != null) {
RemoteDesktopClientObj.DisconnectFromServer();
}
}
function RemoteControlButtonHandler() {
if (RemoteDesktopClientObj != null) {
RemoteDesktopClientObj.ConnectRemoteDesktop();
}
}
function RemoteControlEndButtonHandler() {
if (RemoteDesktopClientObj != null) {
RemoteDesktopClientObj.DisconnectRemoteDesktop();
}
}
function DisconnectedHandler(reason) {
var str = "Unknown Error!!!!";
switch(reason) {
case 0 : str = "SAFERROR_NOERROR";
break;
case 1 : str = "SAFERROR_NOINFO";
break;
case 3 : str = "SAFERROR_LOCALNOTERROR";
break;
case 4 : str = "SAFERROR_REMOTEBYUSER";
break;
case 5 : str = "SAFERROR_BYSERVER";
break;
case 6 : str = "SAFERROR_DNSLOOKUPFAILED";
break;
case 7 : str = "SAFERROR_OUTOFMEMORY";
break;
case 8 : str = "SAFERROR_CONNECTIONTIMEDOUT";
break;
case 9 : str = "SAFERROR_SOCKETCONNECTFAILED";
break;
case 11 : str = "SAFERROR_HOSTNOTFOUND";
break;
case 12 : str = "SAFERROR_WINSOCKSENDFAILED";
break;
case 14 : str = "SAFERROR_INVALIDIPADDR";
break;
case 15 : str = "SAFERROR_SOCKETRECVFAILED";
break;
case 18 : str = "SAFERROR_INVALIDENCRYPTION";
break;
case 20 : str = "SAFERROR_GETHOSTBYNAMEFAILED";
break;
case 21 : str = "SAFERROR_LICENSINGFAILED";
break;
case 22 : str = "SAFERROR_ENCRYPTIONERROR";
break;
case 23 : str = "SAFERROR_DECRYPTIONERROR";
break;
case 24 : str = "SAFERROR_INVALIDPARAMETERSTRING";
break;
case 25 : str = "SAFERROR_HELPSESSIONNOTFOUND";
break;
case 26 : str = "SAFERROR_INVALIDPASSWORD";
break;
case 27 : str = "SAFERROR_HELPSESSIONEXPIRED";
break;
case 28 : str = "SAFERROR_CANTOPENRESOLVER";
break;
case 29 : str = "SAFERROR_UNKNOWNSESSMGRERROR";
break;
case 30 : str = "SAFERROR_CANTFORMLINKTOUSERSESSION";
break;
case 31 : str = "SAFERROR_SHADOWFAILED";
break;
case 32 : str = "SAFERROR_RCPROTOCOLERROR";
break;
case 33 : str = "SAFERROR_RCUNKNOWNERROR";
break;
case 34 : str = "SAFERROR_INTERNALERROR";
break;
}
var msg = "ClientHost_Disconnected: " + str;
alert(msg);
}
function RemoteControlRequestCompleteHandler(status) {
var str = "!!!!Unknown Error ... you Better not Check In!!!!";
if (status != 0) {
switch(status) {
case 301 : str = "SAFERROR_SHADOWEND_CONFIGCHANGE";
break;
case 302 : str = "SAFERROR_SHADOWEND_UNKNOWN";
break;
}
var msg = "RemoteControlRequestCompleteHandler: " + str;
alert(msg);
}
}
function ChannelDataReadyHandler(channelID) {
var str;
str = ChatChannel.ReceiveChannelData();
incomingChatText.value = incomingChatText.value + "\n" + str;
}
function ConnectButtonHandler() {
RemoteDesktopClientObj = ClientHost.GetRemoteDesktopClient();
// RemoteDesktopClientObj.EnableSmartSizing = true;
// Bind the event handlers for this object.
RemoteDesktopClientObj.OnConnected = function()
{ ConnectedHandler(); }
RemoteDesktopClientObj.OnDisconnected = function(reason)
{ DisconnectedHandler(reason); }
RemoteDesktopClientObj.OnConnectRemoteDesktopComplete = function(status)
{ RemoteControlRequestCompleteHandler(status); }
// Add the 'chat' channel.
ChannelManager = RemoteDesktopClientObj.ChannelManager;
if (ChatChannel == null) {
ChatChannel = ChannelManager.OpenDataChannel("70");
ChatChannel.OnChannelDataReady = function()
{ ChannelDataReadyHandler(); }
}
RemoteDesktopClientObj.ConnectParms = parmsInput.value;
RemoteDesktopClientObj.ConnectToServer("12345");
}
</SCRIPT>
</BODY>
</HTML>