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.
 
 
 
 
 
 

172 lines
5.1 KiB

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY topMargin=0>
<OBJECT classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7 height=0 id=oSAFClassFactory width=0></OBJECT>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P align=center><FONT face="Times New Roman" size=5><STRONG>Unsolicited Remote Control Unittest</STRONG></FONT></P>
<TABLE>
<TR>
<TD><BUTTON id=CreateRemoteDesktopConnectionButton name=CreateRemoteDesktopConnectionButton onclick=CreateRemoteDesktopConnectionButtonHandler()>CreateRemoteDesktopConnection</BUTTON></TD>
</TR>
<TR>
<TD><I style size=20> Enter Server Name to invoke </I><B> ConnectRemoteDesktop </B> <INPUT name="ServerName" id="ServerName" style="WIDTH: 310px; HEIGHT: 20px;" size=40>&nbsp;&nbsp;&nbsp;</TD>
<TD><BUTTON id=ConnectRemoteDesktopButton name=ConnectRemoteDesktopButton onclick=ConnectRemoteDesktopButtonHandler()>ConnectRemoteDesktop</BUTTON></TD>
</TR>
<TR><TD><BUTTON id=UsersButton name=UsersButton onclick=UsersButtonHandler()>Users</BUTTON></TD></TR>
<TR><TD><BUTTON id=SessionsButton name=SessionsButton onclick=SessionsButtonHandler()>Sessions</BUTTON></TD></TR>
<TR><TD><BUTTON id=RemoteConnectionParametersButton name=RemoteConnectionParametersButton onclick=RemoteConnectionParametersButtonHandler()>RemoteConnectionParameters</BUTTON></TD></TR>
<TR><TD><BUTTON id=ModemButton name=ModemButton onclick=ModemButtonHandler()>ModemConnected</BUTTON></TD></TR>
</TABLE>
<SCRIPT Language="JScript">
var oSAFRemoteDesktopConnection = null;
var oSAFRemoteConnectionData = null;
var oUsersCollection = null;
var oSessionsCollection = null;
var RemConnectionParms = null;
function CreateRemoteDesktopConnectionButtonHandler()
{
alert("In CreateRemoteDesktopConnection Method");
try
{
oSAFRemoteDesktopConnection = oSAFClassFactory.CreateObject_RemoteDesktopConnection();
alert("SUCCEEDED : CreateRemoteDesktopConnection");
}
catch (e)
{
alert("FAILED : CreateRemoteDesktopConnection with error " + e.Description);
}
}
function ConnectRemoteDesktopButtonHandler()
{
alert("In ConnectRemoteDesktop Method");
if (oSAFRemoteDesktopConnection != null)
{
try
{
oSAFRemoteConnectionData = oSAFRemoteDesktopConnection.ConnectRemoteDesktop(ServerName.value);
alert("SUCCEEDED : ConnectRemoteDesktop");
}
catch (e)
{
alert("FAILED : ConnectRemoteDesktop with error " + e.Description);
}
}
else
{
alert("ERROR : oSAFRemoteDesktopConnection is NULL");
}
}
function UsersButtonHandler()
{
alert("In Users Method");
if (oSAFRemoteConnectionData != null)
{
try
{
oUsersCollection = oSAFRemoteConnectionData.Users();
alert("SUCCEEDED : Users");
// List the UsersCollection's details.
var nUsersLen = oUsersCollection.Count;
alert("Total Users Logged on : "+nUsersLen);
for(i=1; i<= nUsersLen; i++)
{
oUserObj = oUsersCollection.item(i);
alert("Index : " +i+" UserName : "+oUserObj.UserName+" DomainName : "+oUserObj.DomainName);
}
}
catch (e)
{
alert("FAILED : Users with error " + e.Description);
}
}
else
{
alert("ERROR : oSAFRemoteConnectionData is NULL");
}
}
function SessionsButtonHandler()
{
alert("In Sessions Method");
if (oSAFRemoteConnectionData != null)
{
try
{
oSessionsCollection = oSAFRemoteConnectionData.Sessions();
alert("SUCCEEDED : Sessions");
// List the SessionsCollection's details.
var nSessionsLen = oSessionsCollection.Count;
alert("Total Sessions : "+nSessionsLen);
for(i=1; i<= nSessionsLen; i++)
{
oSessionObj = oSessionsCollection.item(i);
alert("Index : " +i+" UserName : "+oSessionObj.UserName+" DomainName : "+oSessionObj.DomainName+" SessionID "+oSessionObj.SessionID+" SessionState "+oSessionObj.SessionState);
}
}
catch (e)
{
alert("FAILED : Sesions with error " + e.Description);
}
}
else
{
alert("ERROR : oSAFRemoteConnectionData is NULL");
}
}
function RemoteConnectionParametersButtonHandler()
{
alert("In RemoteConnectionParameters Method");
if (oSAFRemoteConnectionData != null)
{
try
{
oSessionObj = oSessionsCollection.item(1);
RemConnectionParms = oSAFRemoteConnectionData.ConnectionParms(ServerName.value, oSessionObj.UserName, oSessionObj.DomainName, oSessionObj.SessionID, "");
alert("SUCCEEDED : RemoteConnectionParms "+RemConnectionParms);
}
catch (e)
{
alert("FAILED : RemoteConnectionParms with error " + e.Description);
}
}
else
{
alert("ERROR : oSAFRemoteConnectionData is NULL");
}
}
function ModemButtonHandler()
{
alert("In the Modem Button Handler");
if (oSAFRemoteConnectionData != null)
{
fConnected = oSAFRemoteConnectionData.ModemConnected(ServerName.value);
alert("ModemConnected = " + fConnected);
}
}
</SCRIPT>
</BODY>
</HTML>