none
How to read files on remote system using remote desktop in C#? RRS feed

  • Question

  • Hi, I want to use read a couple of files located on a system that can be reached by starting a remote desktop.
    We don't want to create a lot of shares on the remote system but want to have a login security so remote desktop looks fine.
    I want to do the reading from a C# application.
    I have looked for a sample but not found any with file access, any ideas how to do this.

    Regards
    Patrik Svensson

    Wednesday, October 23, 2013 3:48 PM

Answers

  • Hi Patrik,

    Please have a look at this post, it was about how to map network drive. http://www.codeproject.com/Articles/6847/Map-Network-Drive-API.

    > No one or two shares are not many but the customer was a bit nervous about shares that was available all the time. But as you points out the adminstrative share are always available? So it should not be worse than the other shares.

    This API has the advantage that you could map the drive when necessary and you could unmap the drive when mission complete.

    I hope this could give you inspiration.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 28, 2013 9:41 AM
    Moderator

All replies

  • It's no different from reading any other file, you just need to know its location. If you're not willing to create any shares (is one a lot?) then you'd need to use the administrative shares C$, D$ etc.  The file path is something like \\servername\C$\SomesFiles\File.txt.

    Phil Wilson

    Wednesday, October 23, 2013 5:57 PM
  • You use IMsRdpClientAdvancedSettings::RedirectDrives to mount drives to \\tsclient if you are using the ActiveX.


    Visual C++ MVP

    Wednesday, October 23, 2013 10:29 PM
  • Yes, but I want to read from the client side to the server.
    I managed to do a net use tsclient on the server for copy file back to client, but that not what I really want.
    As the machine on the remote desktop server is an old XP I have not been able to start a program from my client, I think it must be a Server for doing that.

    Regards
    Patrik Svensson

    Friday, October 25, 2013 3:32 PM
  • OK thanks, it's an idea.
    No one or two shares are not many but the customer was a bit nervous about shares that was available all the time. But as you points out the adminstrative share are always available?
    So it should not be worse than the other shares.

    But to get back to Remote Desktop, there is no simple way to open a file from the client to server under a remote desktop session? If I run a program on the server it could access my drives on the client. Problem is that I have not had any luck with starting such program as I think it's only possible if the server is a Server 2008 which I don't have (XP Professional PC).

    Regards
    Patrik Svensson

    Friday, October 25, 2013 3:41 PM
  • Hi Patrik,

    Please have a look at this post, it was about how to map network drive. http://www.codeproject.com/Articles/6847/Map-Network-Drive-API.

    > No one or two shares are not many but the customer was a bit nervous about shares that was available all the time. But as you points out the adminstrative share are always available? So it should not be worse than the other shares.

    This API has the advantage that you could map the drive when necessary and you could unmap the drive when mission complete.

    I hope this could give you inspiration.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 28, 2013 9:41 AM
    Moderator