locked
C# Remote Desktop over the same computer RRS feed

  • Question

  • Hello,

    I'm trying to connect to remote desktop services from the same computer (even if it locks my session) from a c# application.

    So far I've tried with an ActiveX control from AxMstsc library but it doesn't work on a console application next I've tried with MsRdpClient7NotSafeForScripting but it won't connect at all. Is there a way of doing this or am I missing something?

     

    Thanks.

    Tuesday, October 4, 2011 8:08 AM

Answers

  • Hi iamcypher,

    Welcome to the MSDN forum!

     

    I am sorry for this late response.

     

    There are some workarounds that enable user to use Remote Desktop to connect to local PC for another desktop session.

    http://www.mydigitallife.info/workaround-for-remote-desktop-client-to-connect-to-localhost-local-terminal-server-service/

    Workaround 1: Connect Remote Desktop Connection (RDC) to 127.0.0.2

    Workaround 2: Connect to RDC Terminal Services at Different Non Standard Port

    Workaround 3: Run Remote Desktop Connection (mstsc.exe) Simulated as Another Operating System

     

    Have a nice day!
    Yoyo.

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Paul Csiki Friday, October 14, 2011 6:40 PM
    Friday, October 14, 2011 2:52 AM

All replies

  • Hi iamcypher;

    Can you elaborate a little more upon what you are trying to achieve?

    At first glance it appears that you are attempting to RDP into localhost, which dosn't make much sense, so dosn't seem like I'm understanding what you are trying to do.

     


    jz
    Tuesday, October 4, 2011 10:00 AM
  • Hello,

    I'm trying to create an application that can connect to the rdp from a console application:

                MsRdpClient7 rdp = new MsRdpClient7() { Server = "192.168.2.109", UserName = "user" };
                rdp.AdvancedSettings8.ClearTextPassword = "user";
                rdp.Connect();
                Console.WriteLine(rdp.Connected);
                Console.ReadLine();
    

    I'm trying something like this but it's always returning connected zero.

    Tuesday, October 4, 2011 10:24 AM
  • please read "Remote Desktop using C#.NET" article to know more about how you can connect to a remote/local desktop! this article use Microsoft Terminal Services Client ActiveX control. you can read "Palantir - Remote Desktop Manager" to implement remote desktop in managed code!

    Any fool can know. The point is to understand.(Albert Einstein)
    Tuesday, October 4, 2011 12:21 PM
  • Hello,

     

    Yes I already looked over both links, my problem is that I can't use rdp client from a console or class library application. Becuase it's bound to work with a form. Try testing it yourself and you will see what I mean.

    Tuesday, October 4, 2011 1:55 PM
  • if you need some classes of System.Windows.Forms, you can add a reference to System.Windows.Forms DLL in console or library projects!

    if your problem is not solved, Please tell me what do you want to do exactly?


    Any fool can know. The point is to understand.(Albert Einstein)
    Wednesday, October 5, 2011 9:15 AM
  • What I want is to make an rdp connection to localhost from localhost. Is there any way of modding the rdp to allow this kind of connection?

    Thursday, October 6, 2011 7:06 AM
  • Hi iamcypher,

    Welcome to the MSDN forum!

     

    I am sorry for this late response.

     

    There are some workarounds that enable user to use Remote Desktop to connect to local PC for another desktop session.

    http://www.mydigitallife.info/workaround-for-remote-desktop-client-to-connect-to-localhost-local-terminal-server-service/

    Workaround 1: Connect Remote Desktop Connection (RDC) to 127.0.0.2

    Workaround 2: Connect to RDC Terminal Services at Different Non Standard Port

    Workaround 3: Run Remote Desktop Connection (mstsc.exe) Simulated as Another Operating System

     

    Have a nice day!
    Yoyo.

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Paul Csiki Friday, October 14, 2011 6:40 PM
    Friday, October 14, 2011 2:52 AM
  • Thank You.
    Friday, October 14, 2011 6:40 PM
  • You are welcome.

    Have a nice day!


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Saturday, October 15, 2011 2:13 PM