0

I have one little windows form program with 2 buttons , the objective is to open executables , i did it already , yet i want the program to login with my credencials in those executables , accessing to a file where my user id and password is and then writing it in the login box .

Thanks

Nikson K John
  • 455
  • 5
  • 13
Miguel
  • 35
  • 6

1 Answers1

3

If the other program doesn't accept login credentials on their command line then consider using SendKeys to send the keystrokes directly. Check out this answer: C# using Sendkey function to send a key to another application

Community
  • 1
  • 1
Steven Palmer
  • 300
  • 2
  • 12
  • And is it possible to access to a file text and copy the credencials from there to the executable ? – Miguel Nov 25 '15 at 09:58
  • Yes, it is possible. You will need to do some research into file I/O in C# to understand how to implement this. The MSDN page here -https://msdn.microsoft.com/en-us/library/ms404278(v=vs.110).aspx - is a good start. – Steven Palmer Nov 25 '15 at 10:57
  • Thank you , one last thing , the command to read from a text file will read everything in the file or i can say to the program to get some line of information ? – Miguel Nov 25 '15 at 11:07
  • Yes. Check out the ReadLine method on the same StreamReader class. https://msdn.microsoft.com/en-us/library/system.io.streamreader.readline(v=vs.110).aspx – Steven Palmer Nov 25 '15 at 11:38