TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Arka Bhattacharjee
NA
5
0
Kill Process from task manager
Jan 21 2010 5:48 PM
I did a
project in vb.net, 3.5 framework using Visual Studio 2008
.My Question is regarding killing the process from task manager. Whenever I am
exiting
my application by the
Close button ('X') or an Exit button
(P.S here
'Exit'
is a
button
in the windows application) the process exists in the task manager and I had to remove it manually. I don't want to do that. The name of the process is iMaxAutotech.exe. I have used this code under form_closing event and in the exit button but it's not working ..grrh!!!
Under Exit Button :
Private Sub Exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim mresult As MsgBoxResult
mresult = MsgBox("Are you sure you want to exit?", MsgBoxStyle.YesNo)
If mresult = MsgBoxResult.Yes Then
Me.Close()
End If
Dim plist As Process() = Process.GetProcesses()
For Each p As Process In plist
Try
If p.MainModule.ModuleName.ToUpper() = "iMaxAutotech.exe" Then p.Kill()
Catch
'seems listing modules for some processes fails, so better ignore any exceptions here
End Try
Next p
End Sub
and in the Form Closing Event :
Private Sub Form3_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
Dim plist As Process() = Process.GetProcesses()
For Each p As Process In plist
Try
If p.MainModule.ModuleName.ToUpper() = "iMaxAutotech.exe" Then p.Kill()
Catch
'seems listing modules for some processes fails, so better ignore any exceptions here
End Try
Next p
End Sub
I want the vb.net code for that
,can any1 help me plz plz.It's very urgent ...Thanks in advance
Reply
Answers (
2
)
How to change the mailbox name in outlook 2003 and/or 2007
Add Installers witha project exe application