-1

Hy,

I need to launch a vnc viewer in a winform (ultravnc in my case) and I need to send two parameters to see the remote desktop and after several issues, I can't find any solutions.

        System.Diagnostics.Process proc = new System.Diagnostics.Process();
        proc.EnableRaisingEvents = false;
        proc.StartInfo.FileName = "C:/Program Files/uvnc bvba/ultravnc/vncviewer.exe";
        proc.StartInfo.Arguments = host;
        proc.Start();

the first argument "host" is the ip of the pc and that just work. After that, ultravnc ask me the password for the remote desktop connection.

And this is where I can't find any solutions :

1)I try to add a second arguments : proc.StartInfo.Arguments = mdpVNC; But VNC take this as a replacement of the "host" variable.

2)I try to use the SendKeys class but it doesn't work

3)I try the property "PasswordInClearText" but that doesn't work either.

I try several things and I don't want to use an external package (like vncSharp or other, because these solutions don't suit me)

I need help plz.

Thanks in advance.

MrOizo
  • 16
  • 3
  • 1
    Arguments are a replacement for user input *only if that's how the target program has been specifically written to behave*. They're not interchangable. – Damien_The_Unbeliever Jul 09 '18 at 14:51
  • 3
    Have you taken a look at the [UltraVNC Viewer documentation page for Command Line Parameters](https://www.uvnc.com/docs/uvnc-viewer/52-UltraVNC-viewer-commandline-parameters.html)? – bassfader Jul 09 '18 at 14:52
  • `proc.StartInfo.Arguments = host + " -password bla"`; – Renatas M. Jul 09 '18 at 14:56

1 Answers1

0

StartInfo.Arguments is a string, and you put in there the arguments. Make the string that has the arguments as you would write them in the command line. For example:

startInfo.Arguments = "host -dsmplugin msrc4plugin.dsm";

That is for the first example in UltraVNC Viewer Commandline Parameters .

Or whatever you need.

Theraot
  • 31,890
  • 5
  • 57
  • 86