I need to command a program with c# | SoloLearn: Learn to code for FREE!


I need to command a program with c#

Using process class every time but to change arguments I need to launch the program again and again an that makes the code heavy and some programs doesn't accept lunching multiple times

6/3/2020 6:53:08 AM


4 Answers

New Answer


However, you can make a global variable by creating a static class in a separate class file in your application. First, create a class called global in your application with the code given below. The class also has a static variable. Now, you can access it from anywhere in your forms after assigning a value to it. Using gobal declarations or variables help in reducing messy coding.


Using global variables is messy coding, not a solution to messy coding. When it is necessary to automate or control other applications it is usually preferable to use a scripting language such as the built in command interpreter or some other scripting language. Not knowing the exact nature of the problem, the programs involved, or even the operating system in use it's difficult to provide an optimal answer.


Am sorry can you explain it some more I don't know how to make a separated class but I will google it But how can I call the class in the program And how it will service me with my problem Still I will have to start the program and close it every time I need to pass an argument I am working with adb.exe and it take time to launch every time that's making my program to freeze


Am trying to work with adb.exe Lunch adb with command read output then if its suitble send anothe command to android device The problem when relaunching adb over and over Can't I send arguments to prelaunched program ?