Pass Login Enter Password to an external application. C# with Windows Forms

Asked

Viewed 136 times

0

I used the code passed in

Write program in another’s textbox

To write login/password in another manufacturer’s program.

I did so:

Process processo = Process.Start(@"C:\Program Files (x86)\ZKTeco\ZKAccess3.5\Access.exe");
IntPtr h = processo.MainWindowHandle;
SetForegroundWindow(h);
processo.WaitForInputIdle(); // Isso aqui foi de extrema importância :D.

SendKeys.SendWait("admin");
SendKeys.SendWait("{TAB}");
SendKeys.SendWait("admin");
SendKeys.SendWait("{ENTER}");

It even calls the system, but does not pass the values to the respective fields.

  • Thanks for editing the theme Joao Martins, I’m new and I don’t know how to use the forum yet...

  • when opening the program the focus is in the first text field? example, if you open the program manually and only type, it fills the login field?

  • Yes, this one focuses on the Login field

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.