Click here to Skip to main content
Click here to Skip to main content

Palantir - Remote Desktop Manager

, 6 Aug 2007
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

 
GeneralAdditions PinmemberDaaron30-Apr-10 11:48 
QuestionHow to access an IP that is behind the NAT router ? Pinmemberdmuntoiu6-Mar-10 1:57 
AnswerRe: How to access an IP that is behind the NAT router ? Pinmembergrantmaster26-Sep-12 6:40 
GeneralRe: How to access an IP that is behind the NAT router ? PinmemberJoe Escalona26-Sep-12 7:35 
Generalproblem when auto connecting Pinmemberatropos073-Mar-10 21:24 
GeneralGood Work PinmemberNezam Ahamed22-Feb-10 18:37 
Generalbeautiful! Pinmemberkanbang11-Aug-09 23:03 
Questioncan u please tell now i am getting this error after change AxMsRdpClient5 to AxMsRdpClient2 Pinmemberravileeladhar20-Jul-09 7:42 
Error 3 'AxMSTSCLib.AxMsRdpClient2' does not contain a definition for 'AdvancedSettings5' F:\ARJUN_LINKS\Palantir - Remote Desktop Manager\palantir_src\Palantir\Palantir\ControlLib\RemoteDesktopControllerTabPage.cs 53 22 Palantir
GeneralException ::Error 8 'AxMSTSCLib.AxMsRdpClient4.AdvancedSettings5' is not supported by the language Palantir Pinmemberravileeladhar9-Jul-09 7:40 
GeneralRe: Exception ::Error 8 'AxMSTSCLib.AxMsRdpClient4.AdvancedSettings5' is not supported by the language Palantir PinmemberAKGhosh19-Jul-09 20:25 
GeneralNice Article PinmemberVuyiswa Maseko4-Mar-09 21:14 
GeneralNeed your help! Error:Class not registered... PinmemberMember 388611715-Feb-09 14:50 
GeneralError with mstscax.dll PinmemberMember 393854815-Jan-09 17:33 
Questionerror!!!!. what pas? PinmemberAlejandroDG17-Oct-08 19:42 
AnswerRe: error!!!!. what pas? Pinmemberric43215-Nov-09 4:53 
Generalplease clear my doubt... [modified] Pinmembersgsiva17-Sep-08 23:44 
AnswerRe: please clear my doubt... PinmemberJim Weiler19-Nov-08 18:33 
GeneralRe: please clear my doubt... PinmemberKevin James10-Feb-09 22:20 
QuestionBuild errors with VS 2005 Pinmembercuriousharry22-Sep-07 15:16 
AnswerRe: Build errors with VS 2005 PinmemberGrantS23-Oct-07 22:40 
GeneralGreat.. PinmemberMurat Firat12-Sep-07 7:11 
QuestionQuery PinmemberRajendrakumara24-Aug-07 20:15 
GeneralWorked at office, error at home Pinmemberzafer_arsay13-Aug-07 22:30 
QuestionWhat is in this name? PinmemberSAKryukov9-Aug-07 12:02 
AnswerRe: What is in this name? PinmemberSacha Barber9-Aug-07 20:48 

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 | Mobile
Web04 | 2.8.140827.1 | Last Updated 7 Aug 2007
Article Copyright 2007 by Isil Orhanel
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid