writeline to an application
Hi all,
I'am writing a small application where i start an vpn connection to our network and after the connection is made i start a terminal session. I would like to login automaticely with username and password.
That's the way I do it:
Dim proc As New Process
Dim proccontrol As New System.Diagnostics.ProcessStartInfo
proccontrol.FileName = "c:\windows\system32\mstsc"
proccontrol.Arguments = ("/v:10.48.1.17")
proccontrol.RedirectStandardInput = True
proccontrol.UseShellExecute = False
proccontrol.RedirectStandardOutput = True
proccontrol.RedirectStandardError = True
proc = Process.Start(proccontrol)
Thread.Sleep(10000);let the application start
proc.StandardInput.WriteLine("username")
proc.StandardInput.Flush()
proc.WaitForExit()
problem is that the terminal session is starting but it seems as "username" is not send to the application.
I even try to start notepad in the same way but text is not passed to the application
Any suggestions ?
Vinny_68
|