ARTICLE

Process Control in VB.NET

Posted by Shalini Juneja Articles | ASP.NET using VB.NET March 30, 2011
In this artricle we demonstrate on what is Process Control and how can you open a folder with Process Control.
Download Files:
 
Reader Level:


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

 

Login to add your contents and source code to this article
share this article :
post comment
 
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Team Foundation Server Hosting
Become a Sponsor