I am using the following line of code to launch a keylogger I made:
ProcessStartInfo keylogger = new ProcessStartInfo(@"C:\keylogger.exe");
keylogger.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(keylogger);
When I used this code the keylogger launches but doesn't log any keystrokes. I thought this was because of trying to hide the process window, so I changed the code to this:
ProcessStartInfo keylogger = new ProcessStartInfo(@"C:\keylogger.exe");
Process.Start(keylogger);
Still the same problem, I even tried Process.Start(@"C:\keylogger.exe"); alone and even that doesn't seem to work.
In all cases the keylogger launches but doesn't record any keystrokes to the log file. But if I double click and open the keylogger it works perfectly fine.