What library do I need to reference for remote connection to RDC server from console app?

StackOverflow https://stackoverflow.com/questions/4571425

  •  14-10-2019
  •  | 
  •  

سؤال

We have a terminal server: "server.host.com". Normally, we RDP into that server for our business applications. However, I am performing some datamining and want to bring the .xml files to a local system for post processing.

My utility app would basically log in (impersonating my account), navigate to the directory where the .xml files are stored, then begin copying to a local directory. This utility would be set to run every morning at 3am unattended.

I am trying to determine whether WMI is the correct library, or Remoting, or some other library? Is this even going to be possible?

هل كانت مفيدة؟

المحلول

So if you are looking at using Microsoft's remote desktop, you can add a reference to Microsoft Terminal Services Control Type Library in the COM section. If you are working with a gui, you can just drag the control and do something like:

rdp.Server = txtServ.Text;
rdp.UserName = txtUser.Text;
IMsTscNonScriptable secured = (IMsTscNonScriptable)rdp.GetOcx();
secured.ClearTextPassword = txtPassword.Text;
rdp.Connect();

If you are using the console, should be just as simple just without the buttons and all.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top