C#|Start Remote Desktop as a Process + Put text in the textbox
well, the title of this qustions is abit stupid, but i will expline it very very simple.
in my 开发者_开发问答code, i am strating a remote deskop.exe
like this:
Process rtc;
rtc = Process.Start(@"C:\Windows\System32\mstsc.exe");
now, the thing is. when the remote deskop comes up(its work) i will like to know how can i put a name in the textbox on the connction.
so when the remote will be up, the conntion name will be there, or a ip.
is it even posibale?
mstsc has a lot of command line parameters you can pass to it:
MSTSC [<connection file>] [/v:<server[:port]>] [/admin] [/f[ullscreen]] [/w:<width> /h:<height>] [/public] | [/span] [/multimon] [/migrate] [/edit "connection file"]
"connection file" -- Specifies the name of an .RDP file for the connection.
/v:<server[:port]> -- Specifies the remote computer to which you want to connect.
/admin -- Connects you to the session for administering a server.
/f -- Starts Remote Desktop in full-screen mode.
/w:<width> -- Specifies the width of the Remote Desktop window.
/h:<height> -- Specifies the height of the Remote Desktop window.
/public -- Runs Remote Desktop in public mode.
/span -- Matches the remote desktop width and height with the local virtual desktop, spanning across multiple monitors, if necessary. To span across monitors, the monitors must be arranged to form a rectangle.
/multimon -- Configures the remote desktop session monitor layout to be identical to the current client-side configuration.
/edit -- Opens the specified .RDP connection file for editing.
/migrate -- Migrates legacy connection files that were created with Client Connection Manager to new .RDP connection files.
Use the /v
argument:
Process.Start("mstsc.exe", string.Format("/v:{0}:{1}", server, port));
You can launch mstsc.exe
with the parameter -v:<remoteip|remotemachine>
to achieve the same ( the user will be prompt for the login credentials )
精彩评论