Process in Visual Basic .NET

Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

This lesson describes the Process control


Process

This component provides access to the processes that run on the computer, and you can use this object to start, stop, and monitor processes.

You can also use the object to get information about a running process such as its threads, the modules it has loaded, and the amount of memory it is using.

When you add a new Process instance to the form, you set values in its StartInfo property to define the application to run.

properties

For example, if you set the FileName property to "C:\cv.txt" and then set the Verb property to Open and then just call its Start method, the cv.txt will be opened in a notepad or another software associated with the text files.

    Process1.Start()


You can set these properties programmatically as well:

    Process1.StartInfo.FileName = "C:\cv.txt"
    Process1.StartInfo.Verb = "Open"
    Process1.Start()


You can also loop through the running processes like the following:

    For Each proc As Process In Process.GetProcesses
        Console.WriteLine(proc.ProcessName)
    Next

Previous Lesson | Next Lesson


Share This

Subscribe

More Tutorials

Popular

Home | About | Contact | Privacy Policy

Copyright visual-basic-tutorials.com 2017 - All Rights Reserved.