How to get and Kill the Processes Using Vb.net?   Leave a comment

hello fnds i am come back after long break .. but here is interesting topic for you… How to Get and Kill the Process using Vb.net…

ok … We know Vb.net has a many inbuilt Classes Which help us to Full fill our requirement ….

Steps:-

1. First Start Visual basic and Create new Windows Application … Call Task-handler ….
2. Now … you can see one form …. in form add one listbox and three buttons …. call GetProcess,Kill and Close…. it’s look like this ….

 3. ok… double Click on GetAll Process Button and it can open new Code Windows … In this Write Following Code ….

  ListBox1.Items.Clear()
    Dim pro() As Process
    pro = Process.GetProcesses
    For Each proc As Process In pro
    ListBox1.Items.Add(proc.ProcessName)
   Next

4. This Can add the All Process in Listbox1…

5.Now Code for Kill Button .. Open the Code Window Of Kill button and Write Following Code ….

 Dim pr() As Process = Process.GetProcessesByName(ListBox1.SelectedItem)
        For Each p As Process In pr
            p.Kill()
        Next

6. Ok to kill Process First Select Process From ListBox and then Press Kill button …..
Done the mini task-manager is ready for you enjoy ….. it …
This is a Basic you can manipulate It According to  your Logic…..

Download Sample Code From Here… (Click me…)

Posted December 9, 2011 by smarthacker5 in VB.Net

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: