My question is probably very simple but I am fairly new to developing so thanks in advance for anyone's help. So I have created a very simple mp3 player using windows forms application and C# I have also wrote a very simple keylogger program. Now Im stuck trying to figure out how to basicly execute the keylogger program when the stop button is clicked on the mp3 player. Again thanks in advance for any helpIve searched for answers but have yet to find something that that kind of hits close to what im looking for.
Asked
Active
Viewed 1,073 times
-1
-
3There are a lot of helpful answers to this (http://stackoverflow.com/questions/9679375/run-an-exe-from-c-sharp-code). – Bo Søborg Petersen Jan 03 '16 at 21:41
-
MP3 player, **Keylogger**??? What has a keylogger to do with MP3 player? – TheVillageIdiot Jan 03 '16 at 22:16
-
LOL basicly the purpose is if someone opens this mp3 player when they hit stop it starts this keylogger behind the scenes kinda thing. so while someone thinks they are listening to music clicking the play button it is starting this other program. get it? – cbrannan Jan 03 '16 at 22:44
1 Answers
0
If you mean execute another form in your project you can use the Application.Run(new WhateverYourFormIsCalled()); command or if you want to run another program (.exe file) entirely you could use the process.Start() command. The actual syntax is as follows:
Process.Start("directory file name and extension");
Note you'll need to add a using statement at the top of your file saying using System.Diagnostics;
I'll forward you to https://msdn.microsoft.com/en-us/library/system.diagnostics.process.start(v=vs.110).aspx
Good Luck!

User123
- 31
- 1
- 6