1

Like all games, you are required to login after you start up the game client. In 99% of these cases the client is nice enough to include an option to save your username so you don't have to enter it each time you start the game up. That is not an option for the game i play.

I want to create my own C# program that will launch the game client and automatically send my username as a STDIN to the username textbox.

        Process Game= new Process();
        Game.StartInfo.FileName = "Game.exe";
        Game.StartInfo.UseShellExecute = false;
        Game.StartInfo.RedirectStandardOutput = true;
        Game.StartInfo.RedirectStandardInput = true;


        Game.Start();
        //wait for game client to start up
        Thread.Sleep(30000);

        StreamWriter myStreamWriter = Game.StandardInput;
        String userName= "Test";

        myStreamWriter.WriteLine(userName);
        Console.WriteLine("Check");

So far I have tried something like this, however after i write "Check" to the console there is still nothing in the username text box. What am I missing?

asa
  • 57
  • 8
  • 1
    Depends on the game, of course. If it's a standard Win32 application see [SetText of textbox in external app. Win32 API](https://stackoverflow.com/questions/1100605/settext-of-textbox-in-external-app-win32-api). – John Wu Feb 24 '18 at 01:08

0 Answers0