Click here to Skip to main content
15,435,438 members
Articles / Programming Languages / C#
Posted 1 Aug 2007


314 bookmarked

Palantir - Remote Desktop Manager

Rate me:
Please Sign up or sign in to vote.
4.90/5 (93 votes)
6 Aug 2007CPOL2 min read
Palantir is an application that allows users to manage remote desktop connections in one window. It also allows users to save existing connections for later use.
Screenshot - palantir.jpg

Screenshot - palantir3.jpg


Palantir is an application that allows users to manage remote desktop connections in one window. It also allows users to save existing connections for later use.


The remote desktop connections are managed with Microsoft RDP Client control. This control has all of the properties such as Server, UserName, Domain, etc. in order to set up a remote desktop connection. In addition to these properties, sharing printers, disk drives or color depth of the remote desktop can be managed via RDP Client control. Palantir enables users to create a remote desktop connection and save connection settings for later use. Users can also choose to start a remote desktop connection automatically when the application starts.

The settings can be saved into a file and restored from a setting file. Users can also connect to a computer via console. The application has a class named Machine that stores a remote desktop connection's properties. All of the remote connections created by user is stored in application's .settings file. This setting file has a property setting named MyMachine and its type is string. This property is converted into Hashtable while getting the settings. Palantir's solution consists of four projects which are GUI, Helper, BusinessObjects and a setup project.

Using the Code

The remote desktop connections are retrieved by the function below:

public List<Machine> GetRemoteDesktops()         
    List<Machine> lstMachine = new List<Machine>();             
    if (Settings.Default.MyMachine != "")             
        Hashtable ht = 
        foreach (DictionaryEntry de in ht)                     
            Machine insMachine = (Machine)de.Value;                     
    lstMachine.Sort(delegate(Machine m1, Machine m2) 
        return m1.RemoteDesktopConnectionName.CompareTo(
    return lstMachine;         

As seen in the code, this function deserializes the setting named MyMachine into a hashtable and inserts each dictionary entry in the hashtable into a list and returns the list. A remote desktop connection is saved and edited by the function below:

public bool SaveRemoteDesktop(Machine parMachine, bool openedForEdit)   
    if (Settings.Default.MyMachine == "")
        Hashtable ht = new Hashtable(); 
        Settings.Default.MyMachine = BinarySerializer.ToBinary(ht); 
    Hashtable ht1 = 
    if (!parMachine.SavePassword) 
        parMachine.Password = "";             
    if (!openedForEdit)             
        foreach (DictionaryEntry de in ht1)                 
            if (((Machine)de.Value).RemoteDesktopConnectionName == 
                MessageBox.Show("There is already a 
                                    remote connection with the same name.");                         
                return false;                     
    ht1[parMachine.RemoteDesktopConnectionName] = parMachine; 
    Settings.Default.MyMachine = BinarySerializer.ToBinary(ht1);
    return true; 

If there's no currently saved remote desktop connection, we create a new hashtable and then serialize and save the settings file. After that, we deserialize the settings parameter into a hashtable and after checking if there's another connection with the same name, we save the remote desktop connection with the function's parameter Machine object. The methods below set the RDP Client control's settings and connect to the remote desktop which is passed as parameter.

private void SetRdpClientProperties(Machine parMachine)   
    rdpc.Server = parMachine.MachineName;             
    rdpc.UserName = parMachine.UserName;             
    rdpc.Domain = parMachine.DomainName;             
    if (parMachine.Password != "")             
        rdpc.AdvancedSettings5.ClearTextPassword = parMachine.Password;   
    rdpc.AdvancedSettings5.RedirectDrives = parMachine.ShareDiskDrives;     
    rdpc.AdvancedSettings5.RedirectPrinters = parMachine.SharePrinters; 
    rdpc.ColorDepth = (int)parMachine.ColorDepth;             
    rdpc.Dock = DockStyle.Fill;           
public void Connect(Machine parMachine)         
public void ConnectViaConsole(Machine parMachine)         
    rdpc.AdvancedSettings5.ConnectToServerConsole = true;    


For bug reports and suggestions, feel free to contact me at


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Web Developer
Turkey Turkey
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

QuestionRemote Desktop ASPX Pin
Iyad Moussa23-Aug-21 1:12
MemberIyad Moussa23-Aug-21 1:12 
Questionhow to use this application Pin
AissamInfo8-Aug-20 0:05
MemberAissamInfo8-Aug-20 0:05 
QuestionMerhaba ; Pin
serifcicek9211-Sep-19 20:43
Memberserifcicek9211-Sep-19 20:43 
QuestionI need Help Pin
Member 1450539019-Jun-19 1:14
MemberMember 1450539019-Jun-19 1:14 
QuestionPLEASE HELP (Win10)! Pin
LorneCash27-Mar-18 9:41
MemberLorneCash27-Mar-18 9:41 
QuestionHow to run this program? Pin
Kenmod23-Mar-17 13:49
MemberKenmod23-Mar-17 13:49 
QuestionTebrikler Pin
Member 128924197-Dec-16 8:21
MemberMember 128924197-Dec-16 8:21 
QuestionHow would you log off? Pin
RodrigoAraujo17-Nov-16 7:24
MemberRodrigoAraujo17-Nov-16 7:24 
GeneralAmazing! Pin
Gilberto Teixeira1-May-16 6:25
MemberGilberto Teixeira1-May-16 6:25 
PraiseThanks For this Pin
Member 122564334-Mar-16 19:45
MemberMember 122564334-Mar-16 19:45 
GeneralRe: Thanks For this Pin
Member 1374113023-Mar-18 3:59
MemberMember 1374113023-Mar-18 3:59 
Questiontcp/ip? Pin
Member 872300322-May-15 7:06
MemberMember 872300322-May-15 7:06 
QuestionServer Name can be a remote IP? (and you look REALLY CUTE in that pic, really) Pin
almend19-Feb-15 12:29
professionalalmend19-Feb-15 12:29 
Questionexe Pin
Member 1059457910-Feb-15 4:16
MemberMember 1059457910-Feb-15 4:16 
QuestionGreat work Pin
Stylianos Polychroniadis9-Jan-15 23:53
MemberStylianos Polychroniadis9-Jan-15 23:53 
Questionthanks for code Pin
Member 102290085-Jan-15 23:20
MemberMember 102290085-Jan-15 23:20 
GeneralMy vote of 5 Pin
Maik Kluwe29-Nov-14 11:57
MemberMaik Kluwe29-Nov-14 11:57 
Questionan awsm rdp app.. Pin
Koustuv Ganguly18-Jul-14 5:48
MemberKoustuv Ganguly18-Jul-14 5:48 
QuestionHow do i know ? Pin
expert-programmer4-Dec-13 8:12
Memberexpert-programmer4-Dec-13 8:12 
Questionwow... what a nice article... Pin
sankmahesh3-Dec-13 23:20
Membersankmahesh3-Dec-13 23:20 
SuggestionWhat a sexy developer:* Pin
Luca Alexandru1-Jun-13 12:23
MemberLuca Alexandru1-Jun-13 12:23 
GeneralMy vote of 5 Pin
ole.Grossklaus@gmx.de6-Mar-13 23:13
Memberole.Grossklaus@gmx.de6-Mar-13 23:13 
GeneralMy vote of 4 Pin
DaveGordon13-Jan-13 0:33
MemberDaveGordon13-Jan-13 0:33 
GeneralMy vote of 4 Pin
Mahdi Nejadsahebi7-Dec-12 2:21
MemberMahdi Nejadsahebi7-Dec-12 2:21 
QuestionRDP session is not getting focused Pin
anusha.giliyar2825-Nov-12 19:27
Memberanusha.giliyar2825-Nov-12 19:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.