How To Use Process Control in ASP.NET Using VB.NET

In this article we demonstrate on what is Process Control and how can you open a folder with Process Control.
  • 3724
 

A visual basic Process Control can be used to enable start and stop different processes or application. It can access processes both local and remote. It is a Task Manager that can watch network computers. To give you an idea of how to use the process control we will create a small example.

How to open a folder with process control in VB.NET

  • start by creating a new project.
  • Double click on the button, Process, File Browser Dialog icon in the toolbox to create a button, Process, File Browser Dialog control on the Form. The form will look like given below.
     
    process1.gif

    process2.gif

  • In the forms load event change Button's Text to "Open Folder" and write the below code.

        
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Button1.Text = "Open Folder"
        End Sub

     
  • Create a new Sub and call it MyProcess. You are going to use your process to open any folder on your computer. To do this you are going to make use of windows explorer and simply pass the folder name to it and you have to create the following commands for your Process.

        
    Sub MyProcess()
            Process1.StartInfo.FileName = "Explorer.exe"
            Process1.StartInfo.Arguments = FolderBrowserDialog1.SelectedPath
            Process1.Start()
        End Sub
     

  • When you push your Button you want your FolderBrowser to open so that you can select your folder only than if the FolderBrowserDialog returns OK. You will call your Sub Called MyProcess and run the commands in it. Double click on your Button to open its Event handling Procedure.

        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            If FolderBrowserDialog1.ShowDialog() = DialogResult.OK Then
                MyProcess()
            End If
        End
    Sub

Output

process3.gif

process6.gif

process5.gif

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.