|
-
Apr 5th, 2014, 01:04 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Process start and stop using vb.net application
Hi,
I need to run a .exe using vb.net application and when vb.net application close then .exe also closed.
If application by 5 user then .exe also start 5 time and when particular user close the application then that exe process close not all.
thank
-
Apr 5th, 2014, 04:47 AM
#2
Re: Process start and stop using vb.net application
What have you tired your self? You should obviously be using the forms load and formclosing events.
-
Apr 6th, 2014, 03:50 AM
#3
Fanatic Member
Re: Process start and stop using vb.net application
Im not sure what you mean by user 5 but
Code:
Public Class Form1
Dim myProcess As New Process
Private Sub Form1_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
myProcess.Kill()
End Sub
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
myProcess.StartInfo.FileName = "cmd.exe"
myProcess.Start()
End Sub
End Class
My CodeBank Submissions
- Listbox with transparency and picture support - Click Here
- Check for a true internet connection - Click Here
- Open Cash drawer connected to receipt printer - Click Here
- Custom color and size border around form - Click Here
- Upload file to website without user logins, includes PHP - Click Here
- List All Removable USB Storage Devices - Click Here
- Custom On/Off Slide Control - Click Here
- Insert multiple rows of data into one database table using parameters - Click Here
- Trigger USB/Serial Cash Drawer - Click Here
-
Apr 6th, 2014, 08:29 AM
#4
Re: Process start and stop using vb.net application
You really shouldn't use Kill unless you need to terminate a process that is not responding.
You should attempt to close the window first so apps can ask the user if they want to save their work before they exit if need be.
There are few good examples posted here.
One of them that might be worth looking at,..
http://www.vbforums.com/showthread.php?t=643527
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|