Sep 24, 2016 02:46 PM
(This post was last modified: Sep 24, 2016 06:51 PM by Wakka.)
So most people will start off a tutorial with some "hello world" shit.
Here I'll give you a tutorial on a program that you can make and easily add your own code to.
For this tutorial we will be coding in C#
To follow the steps in this tutorial you should download and install visual studio 2015 which can be found here.
Once you have downloaded and installed visual studio you should press file in the top left corner, new project and then choose visual C# windows forms application, name the solution Windows run utility - or whatever you desire.
Your screen should look something like this:
![[Image: f66742fe84a8ffaf7a5449111138f1f8.png]](https://i.gyazo.com/f66742fe84a8ffaf7a5449111138f1f8.png)
Next press okay your next screen should look like this:
![[Image: 1b2702f017a92d77a8349d4499b7745e.png]](https://i.gyazo.com/1b2702f017a92d77a8349d4499b7745e.png)
Next we want to add some buttons to our application you can do this by opening the toolbox from the toolbox tab on the left of the screen.
Go ahead and double click the object called "button" from the toolbox, this will add a button to your windows form as seen below.
![[Image: f0f1b24a2b6312407e2409ce2d471f6a.png]](https://i.gyazo.com/f0f1b24a2b6312407e2409ce2d471f6a.png)
Your form should now look like this.
![[Image: fdf4eb05c8650233d662b7fb54cab40b.png]](https://i.gyazo.com/fdf4eb05c8650233d662b7fb54cab40b.png)
Now let's give that button a click event. Double click the button (By double clicking the button visual studio will automatically generate some code that will make that button perform a click event - a click event will run code that we will add next.)
The code that visual studio generates will look something like this:
![[Image: 4c1f499a7563eaff664c87c9fed9fef7.png]](https://i.gyazo.com/4c1f499a7563eaff664c87c9fed9fef7.png)
Now let's add the name space using System.Diagnostics; to the top of our code like this
![[Image: b4964ebdde009c14d1cd374a0cae0f81.png]](https://i.gyazo.com/b4964ebdde009c14d1cd374a0cae0f81.png)
Next we need to add a process to run, this will be the main attraction of this program.
Process.Start("Taskmgr.exe");
Copy and paste the above code into the click event.
like so:
![[Image: 25695d6c3718e3d8f22deaf65a7e3eef.png]](https://i.gyazo.com/25695d6c3718e3d8f22deaf65a7e3eef.png)
Now we need to debug our program, and test it.
You can do this by pressing the green play/run button.
![[Image: 276f21480ae234ef1cf73fc4f560a435.png]](https://i.gyazo.com/276f21480ae234ef1cf73fc4f560a435.png)
As you can see by testing the program it succesfully executes task manager.
![[Image: ce7d024ef027fa3969cb7e4076689675.gif]](https://i.gyazo.com/ce7d024ef027fa3969cb7e4076689675.gif)
Now we can save all and build the file and our program is complete, you can add more buttons and repeat the first steps and add some of your own processes to it too, if you want to know the process name go to task manager, right click the task and go to properties.
for more information check here https://msdn.microsoft.com/en-us/library....110).aspx
Here I'll give you a tutorial on a program that you can make and easily add your own code to.
For this tutorial we will be coding in C#
To follow the steps in this tutorial you should download and install visual studio 2015 which can be found here.
Once you have downloaded and installed visual studio you should press file in the top left corner, new project and then choose visual C# windows forms application, name the solution Windows run utility - or whatever you desire.
Your screen should look something like this:
![[Image: f66742fe84a8ffaf7a5449111138f1f8.png]](https://i.gyazo.com/f66742fe84a8ffaf7a5449111138f1f8.png)
Next press okay your next screen should look like this:
![[Image: 1b2702f017a92d77a8349d4499b7745e.png]](https://i.gyazo.com/1b2702f017a92d77a8349d4499b7745e.png)
Next we want to add some buttons to our application you can do this by opening the toolbox from the toolbox tab on the left of the screen.
Go ahead and double click the object called "button" from the toolbox, this will add a button to your windows form as seen below.
![[Image: f0f1b24a2b6312407e2409ce2d471f6a.png]](https://i.gyazo.com/f0f1b24a2b6312407e2409ce2d471f6a.png)
Your form should now look like this.
![[Image: fdf4eb05c8650233d662b7fb54cab40b.png]](https://i.gyazo.com/fdf4eb05c8650233d662b7fb54cab40b.png)
Now let's give that button a click event. Double click the button (By double clicking the button visual studio will automatically generate some code that will make that button perform a click event - a click event will run code that we will add next.)
The code that visual studio generates will look something like this:
![[Image: 4c1f499a7563eaff664c87c9fed9fef7.png]](https://i.gyazo.com/4c1f499a7563eaff664c87c9fed9fef7.png)
Now let's add the name space using System.Diagnostics; to the top of our code like this
![[Image: b4964ebdde009c14d1cd374a0cae0f81.png]](https://i.gyazo.com/b4964ebdde009c14d1cd374a0cae0f81.png)
Next we need to add a process to run, this will be the main attraction of this program.
Process.Start("Taskmgr.exe");
Copy and paste the above code into the click event.
like so:
![[Image: 25695d6c3718e3d8f22deaf65a7e3eef.png]](https://i.gyazo.com/25695d6c3718e3d8f22deaf65a7e3eef.png)
Now we need to debug our program, and test it.
You can do this by pressing the green play/run button.
![[Image: 276f21480ae234ef1cf73fc4f560a435.png]](https://i.gyazo.com/276f21480ae234ef1cf73fc4f560a435.png)
As you can see by testing the program it succesfully executes task manager.
![[Image: ce7d024ef027fa3969cb7e4076689675.gif]](https://i.gyazo.com/ce7d024ef027fa3969cb7e4076689675.gif)
Now we can save all and build the file and our program is complete, you can add more buttons and repeat the first steps and add some of your own processes to it too, if you want to know the process name go to task manager, right click the task and go to properties.
for more information check here https://msdn.microsoft.com/en-us/library....110).aspx


