Click here to Skip to main content
11,412,516 members (72,954 online)
Click here to Skip to main content

Palantir - Remote Desktop Manager

, 6 Aug 2007 CPOL
Rate this:
Please Sign up or sign in to vote.
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

Introduction

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.

Background

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 = 
            (Hashtable)BinarySerializer.BinaryTo(Settings.Default.MyMachine);
        foreach (DictionaryEntry de in ht)                     
        {                     
            Machine insMachine = (Machine)de.Value;                     
            lstMachine.Add(insMachine);                 
        }             
    }               
    lstMachine.Sort(delegate(Machine m1, Machine m2) 
    { 
        return m1.RemoteDesktopConnectionName.CompareTo(
            m2.RemoteDesktopConnectionName); 
    });             
    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); 
        Settings.Default.Save();
    }             
    Hashtable ht1 = 
        (Hashtable)BinarySerializer.BinaryTo(Settings.Default.MyMachine); 
    if (!parMachine.SavePassword) 
    {                 
        parMachine.Password = "";             
    }               
    if (!openedForEdit)             
    {                 
        foreach (DictionaryEntry de in ht1)                 
        {                     
            if (((Machine)de.Value).RemoteDesktopConnectionName == 
                parMachine.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);
    Settings.Default.Save(); 
    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)         
{             
    SetRdpClientProperties(parMachine);             
    rdpc.Connect();         
}           
public void ConnectViaConsole(Machine parMachine)         
{             
    rdpc.AdvancedSettings5.ConnectToServerConsole = true;    
    SetRdpClientProperties(parMachine);        
    rdpc.Connect();         
} 

Feedback

For bug reports and suggestions, feel free to contact me at io1981@hotmail.com.

License

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

Share

About the Author

Isil Orhanel
Web Developer
Turkey Turkey
No Biography provided

Comments and Discussions

 
QuestionServer Name can be a remote IP? (and you look REALLY CUTE in that pic, really) Pin
almendietamor at 19-Feb-15 13:29
memberalmendietamor19-Feb-15 13:29 
Questionexe [modified] Pin
Member 10594579 at 10-Feb-15 5:16
memberMember 1059457910-Feb-15 5:16 
QuestionGreat work Pin
loPetS at 10-Jan-15 0:53
memberloPetS10-Jan-15 0:53 
Questionthanks for code Pin
Member 10229008 at 6-Jan-15 0:20
memberMember 102290086-Jan-15 0:20 
GeneralMy vote of 5 Pin
Maik Kluwe at 29-Nov-14 12:57
memberMaik Kluwe29-Nov-14 12:57 
Questionan awsm rdp app.. Pin
Koustuv Ganguly at 18-Jul-14 6:48
memberKoustuv Ganguly18-Jul-14 6:48 
QuestionHow do i know ? Pin
expert-programmer at 4-Dec-13 9:12
memberexpert-programmer4-Dec-13 9:12 
Questionwow... what a nice article... Pin
sankmahesh at 4-Dec-13 0:20
membersankmahesh4-Dec-13 0:20 
SuggestionWhat a sexy developer:* Pin
Luca Alexandru at 1-Jun-13 13:23
memberLuca Alexandru1-Jun-13 13:23 
GeneralMy vote of 5 Pin
ole.Grossklaus@gmx.de at 7-Mar-13 0:13
memberole.Grossklaus@gmx.de7-Mar-13 0:13 
GeneralMy vote of 4 Pin
Tekku at 13-Jan-13 1:33
groupTekku13-Jan-13 1:33 
GeneralMy vote of 4 Pin
Mahdi Nejadsahebi at 7-Dec-12 3:21
memberMahdi Nejadsahebi7-Dec-12 3:21 
QuestionRDP session is not getting focused [modified] Pin
anusha.giliyar28 at 25-Nov-12 20:27
memberanusha.giliyar2825-Nov-12 20:27 
GeneralMy vote of 5 Pin
agoren at 23-Nov-12 16:56
memberagoren23-Nov-12 16:56 
QuestionMy vote of 5 Pin
Földi Giliszta at 24-Apr-12 4:38
memberFöldi Giliszta24-Apr-12 4:38 
Questioni need help Pin
jeferson Medeiros at 13-Mar-12 17:07
memberjeferson Medeiros13-Mar-12 17:07 
GeneralParabéns muito bom Pin
MMatani at 15-Dec-11 8:30
memberMMatani15-Dec-11 8:30 
GeneralRe: Parabéns muito bom Pin
jeferson Medeiros at 13-Mar-12 17:10
memberjeferson Medeiros13-Mar-12 17:10 
Questionremote desktop Pin
mohanrajkiller at 12-Nov-11 4:38
membermohanrajkiller12-Nov-11 4:38 
QuestionWhat should I enter in Machine Name, Domain, Username and Password? Pin
donvsme at 20-Oct-11 7:22
memberdonvsme20-Oct-11 7:22 
Question:( Pin
kusum nayal at 20-Oct-11 3:48
memberkusum nayal20-Oct-11 3:48 
Questiongood work Pin
kusum nayal at 20-Oct-11 1:47
memberkusum nayal20-Oct-11 1:47 
GeneralMy vote of 5 Pin
ma_guangming at 14-Oct-11 21:07
memberma_guangming14-Oct-11 21:07 
Generalnice article Pin
AJMAL SHAHZAD at 11-May-11 21:58
memberAJMAL SHAHZAD11-May-11 21:58 
GeneralMy vote of 5 Pin
longkk at 21-Apr-11 16:56
memberlongkk21-Apr-11 16:56 
GeneralTebrikler / Congratulations Pin
hepicoder at 5-Mar-11 12:17
memberhepicoder5-Mar-11 12:17 
General5 For my vote Pin
babakzawari at 2-Mar-11 10:43
memberbabakzawari2-Mar-11 10:43 
GeneralMy vote of 5 Pin
SAKryukov at 19-Feb-11 11:13
memberSAKryukov19-Feb-11 11:13 
GeneralLooking at the remote desktop template, help with automating acknowledgement of the legal banner Pin
turbosupramk3 at 27-Dec-10 8:57
memberturbosupramk327-Dec-10 8:57 
GeneralMy vote of 5 Pin
amitsinh parmar at 21-Dec-10 1:32
memberamitsinh parmar21-Dec-10 1:32 
GeneralAdditions Pin
Daaron at 30-Apr-10 12:48
memberDaaron30-Apr-10 12:48 
QuestionHow to access an IP that is behind the NAT router ? Pin
dmuntoiu at 6-Mar-10 2:57
memberdmuntoiu6-Mar-10 2:57 
AnswerRe: How to access an IP that is behind the NAT router ? Pin
grantmaster at 26-Sep-12 7:40
membergrantmaster26-Sep-12 7:40 
GeneralRe: How to access an IP that is behind the NAT router ? Pin
Joe Escalona at 26-Sep-12 8:35
memberJoe Escalona26-Sep-12 8:35 
Generalproblem when auto connecting Pin
atropos07 at 3-Mar-10 22:24
memberatropos073-Mar-10 22:24 
GeneralGood Work Pin
Nezam Ahamed at 22-Feb-10 19:37
memberNezam Ahamed22-Feb-10 19:37 
Generalbeautiful! Pin
kanbang at 12-Aug-09 0:03
memberkanbang12-Aug-09 0:03 
Questioncan u please tell now i am getting this error after change AxMsRdpClient5 to AxMsRdpClient2 Pin
ravileeladhar at 20-Jul-09 8:42
memberravileeladhar20-Jul-09 8:42 
GeneralException ::Error 8 'AxMSTSCLib.AxMsRdpClient4.AdvancedSettings5' is not supported by the language Palantir Pin
ravileeladhar at 9-Jul-09 8:40
memberravileeladhar9-Jul-09 8:40 
GeneralRe: Exception ::Error 8 'AxMSTSCLib.AxMsRdpClient4.AdvancedSettings5' is not supported by the language Palantir Pin
AKGhosh at 19-Jul-09 21:25
memberAKGhosh19-Jul-09 21:25 
GeneralNice Article Pin
Vuyiswa Maseko at 4-Mar-09 22:14
memberVuyiswa Maseko4-Mar-09 22:14 
GeneralNeed your help! Error:Class not registered... Pin
Member 3886117 at 15-Feb-09 15:50
memberMember 388611715-Feb-09 15:50 
GeneralError with mstscax.dll Pin
Member 3938548 at 15-Jan-09 18:33
memberMember 393854815-Jan-09 18:33 
Questionerror!!!!. what pas? Pin
AlejandroDG at 17-Oct-08 20:42
memberAlejandroDG17-Oct-08 20:42 
AnswerRe: error!!!!. what pas? Pin
ric432 at 15-Nov-09 5:53
memberric43215-Nov-09 5:53 
Generalplease clear my doubt... [modified] Pin
sgsiva at 18-Sep-08 0:44
membersgsiva18-Sep-08 0:44 
AnswerRe: please clear my doubt... Pin
Jim Weiler at 19-Nov-08 19:33
memberJim Weiler19-Nov-08 19:33 
GeneralRe: please clear my doubt... Pin
Kevin James at 10-Feb-09 23:20
memberKevin James10-Feb-09 23:20 
Questionpocket pc version? Pin
Jeff Dafing at 17-Aug-08 9:10
memberJeff Dafing17-Aug-08 9:10 
QuestionBuild errors with VS 2005 Pin
curiousharry at 22-Sep-07 16:16
membercuriousharry22-Sep-07 16:16 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150427.1 | Last Updated 7 Aug 2007
Article Copyright 2007 by Isil Orhanel
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid