Location: Symbol Reference > Classes > TJwWTSSessionList Class > TJwWTSSessionList Properties > TJwWTSSessionList.Items Property
JWSCL Documentation
ContentsIndexHome
Example
var
  ATerminalServer: TJwTerminalServer;
  i: Integer;
begin
  // Create Terminal Server instance and allocate memory for it
  ATerminalServer := TjwTerminalServer.Create;

  // Set servername (only in case of remote server)
  ATerminalServer.Server := 'TS001';

  // Remember that EnumerateSessions will automatically connect to the
  // Terminal Server for you. The connect function raises an Exception
  // if the connection attempt was unsuccessfull, so better use try..except
  try
    if ATerminalServer.EnumerateSessions then
    begin
      for i := 0 to ATerminalServer.Sessions.Count-1 do
      begin
        Memo1.Lines.Add(ATerminalServer.Sessions[i].Username);
      end;
    end;
  except
    on E: EJwsclWinCallFailedException do
    begin
     // Handle Exception here
    end;
  end;

  // Free Memory
  ATerminalServer.Free;
end;
Copyright (c) 2010. All rights reserved.
This help was created by Doc-O-Matic sponsored by toolsfactory software inc.