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.
188 lines
4.5 KiB
188 lines
4.5 KiB
<HTML>
|
|
<HEAD>
|
|
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
|
|
<TITLE></TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<P> </P>
|
|
<P> </P>
|
|
<P align=center><FONT face="Arial Black" size=5><STRONG>PCHealth Remote Control
|
|
Unittest (Server)</STRONG></FONT></P>
|
|
|
|
<TABLE>
|
|
<TBODY>
|
|
<TR>
|
|
<TD><BUTTON id=CreateNewSession name=CreateNewSession onclick=CreateNewSession()>Create new RDS Session (Session Resolver not set)</BUTTON></TD>
|
|
<TD></TD>
|
|
</TR>
|
|
</TBODY>
|
|
</TABLE>
|
|
|
|
<TABLE>
|
|
<TBODY>
|
|
<TR>
|
|
<TD><BUTTON id=CreateNewSessionResolve name=CreateNewSessionResolve onclick=CreateNewSessionResolve()>Create new RDS Session (Session Resolver set)</BUTTON></TD>
|
|
<TD></TD>
|
|
</TR>
|
|
</TBODY>
|
|
</TABLE>
|
|
|
|
|
|
<TABLE>
|
|
<TR>
|
|
<TD></INPUT></TD>
|
|
</TR>
|
|
<TR>
|
|
<TD></INPUT></TD>
|
|
<TD></TD>
|
|
</TR>
|
|
</TABLE><BUTTON id=CloseSession name=CloseSession onclick=CloseSession()>Close open RDS Session</BUTTON>
|
|
|
|
<SCRIPT Language="JScript">
|
|
var RDSHost = null;
|
|
var RemoteDesktopSession = null;
|
|
var ChannelManager = null;
|
|
var ChatChannel = null;
|
|
var tFileName = "\\\\pchealth\\public\\rc\\parms.txt";
|
|
|
|
function UpdateConnectParms() {
|
|
if (RemoteDesktopSession != null) {
|
|
var str;
|
|
str = RemoteDesktopSession.ConnectParms;
|
|
connectParms.value = str;
|
|
}
|
|
}
|
|
|
|
function CreateNewSession() {
|
|
|
|
if (RemoteDesktopSession != null)
|
|
{
|
|
alert("Must close existing session first.");
|
|
return;
|
|
}
|
|
|
|
RDSHost = new ActiveXObject("RDSHost.SAFRemoteDesktopServerHost.1");
|
|
RemoteDesktopSession = RDSHost.CreateRemoteDesktopSession(4, 0, 0);
|
|
var x;
|
|
|
|
ChannelManager = RemoteDesktopSession.ChannelManager;
|
|
ChatChannel = ChannelManager.OpenDataChannel("70");
|
|
ChatChannel.OnChannelDataReady = function()
|
|
{ OnChannelDataReadyEvent(); }
|
|
|
|
// Bind events.
|
|
RemoteDesktopSession.OnConnected = function()
|
|
{ OnClientConnected(); }
|
|
RemoteDesktopSession.OnDisconnected = function()
|
|
{ OnClientDisconnected(); }
|
|
|
|
//
|
|
// Save the connection Params
|
|
//
|
|
SaveConnectParms();
|
|
}
|
|
|
|
function CreateNewSessionResolve() {
|
|
|
|
if (RemoteDesktopSession != null)
|
|
{
|
|
alert("Must close existing session first.");
|
|
return;
|
|
}
|
|
|
|
RDSHost = new ActiveXObject("RDSHost.SAFRemoteDesktopServerHost.1");
|
|
RemoteDesktopSession = RDSHost.CreateRemoteDesktopSession(4, 1, 0);
|
|
var x;
|
|
|
|
ChannelManager = RemoteDesktopSession.ChannelManager;
|
|
ChatChannel = ChannelManager.OpenDataChannel("70");
|
|
ChatChannel.OnChannelDataReady = function()
|
|
{ OnChannelDataReadyEvent(); }
|
|
|
|
// Bind events.
|
|
RemoteDesktopSession.OnConnected = function()
|
|
{ OnClientConnected(); }
|
|
RemoteDesktopSession.OnDisconnected = function()
|
|
{ OnClientDisconnected(); }
|
|
|
|
//
|
|
// Save the connection Params
|
|
//
|
|
SaveConnectParms();
|
|
}
|
|
|
|
function SaveConnectParms()
|
|
{
|
|
//
|
|
// Save the connection Params
|
|
//
|
|
var str = RemoteDesktopSession.ConnectParms;
|
|
var fso = new ActiveXObject("Scripting.FileSystemObject");
|
|
var fileHandle = fso.CreateTextFile( tFileName );
|
|
fileHandle.Write( str );
|
|
fileHandle.Close();
|
|
}
|
|
|
|
function OpenExistingSession() {
|
|
|
|
if (RemoteDesktopSession != null)
|
|
{
|
|
alert("Must close existing session first.");
|
|
return;
|
|
}
|
|
|
|
RDSHost = new ActiveXObject("RDSHost.SAFRemoteDesktopServerHost.1");
|
|
RemoteDesktopSession = RDSHost.OpenRemoteDesktopSession(existingParms.value);
|
|
var x;
|
|
|
|
ChannelManager = RemoteDesktopSession.ChannelManager;
|
|
ChatChannel = ChannelManager.OpenDataChannel("70");
|
|
ChatChannel.OnChannelDataReady = function()
|
|
{ OnChannelDataReadyEvent(); }
|
|
|
|
// Bind events.
|
|
RemoteDesktopSession.OnConnected = function()
|
|
{ OnClientConnected(); }
|
|
RemoteDesktopSession.OnDisconnected = function()
|
|
{ OnClientDisconnected(); }
|
|
}
|
|
|
|
function CloseSession() {
|
|
if (RemoteDesktopSession != null) {
|
|
RDSHost.CloseRemoteDesktopSession(RemoteDesktopSession);
|
|
RemoteDesktopSession = null;
|
|
}
|
|
|
|
//
|
|
// Delete Connection Parms
|
|
//
|
|
var fso;
|
|
fso = new ActiveXObject("Scripting.FileSystemObject");
|
|
fso.DeleteFile(tFileName);
|
|
|
|
}
|
|
|
|
function SendChatButtonHandler() {
|
|
if (ChatChannel != null) {
|
|
ChatChannel.SendChannelData(chatText.value);
|
|
}
|
|
}
|
|
|
|
function OnChannelDataReadyEvent(channelName) {
|
|
var str;
|
|
str = ChatChannel.ReceiveChannelData()
|
|
incomingChatText.value = incomingChatText.value + "\n" + str;
|
|
}
|
|
|
|
function OnClientConnected() {
|
|
alert("Client connected.");
|
|
}
|
|
|
|
function OnClientDisconnected() {
|
|
alert("Client disconnected.");
|
|
}
|
|
|
|
</SCRIPT>
|
|
|
|
</BODY>
|
|
</HTML>
|