473,320 Members | 1,993 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Ending a process problem

1
Hi all, firstly i'll say im pretty new to vb.net so cut me some slack! I've started working on a small program which lists all the process's in a listview and gives you the option to end it by clicking a button. I've managed to list the process's but what im stuck on is trying to end it. The code i've got in my button is:

Expand|Select|Wrap|Line Numbers
  1.  
  2.    dim proc as process
  3.  
  4.    Try
  5.       proc = Process.GetProcessById(Listview.SelectedItems(0).Text)
  6.       proc.Kill()
  7.    Catch ex As Exception
  8.       MessageBox.Show(Convert.ToString(ex))
  9.    End Try
  10. End Sub
  11.  
But i get the error "conversion from string "process name" to type Integer is not valid". Any help would be appreciated :-)
Feb 7 '08 #1
1 892
Plater
7,872 Expert 4TB
It looks like the SelectedItem.Text is giving you the process name, not the process ID, check to make sure you're getting the string you desire first.
Feb 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: LarsenMTL | last post by:
Python Users: Based on previous suggestions from this group, I'm attempting to write a python CGI that takes input from an HTML form, invokes a second python script using this input, tells the...
22
by: Jim Hubbard | last post by:
I am reposting a portion of a thread that I am involved in under a new topic because it seems that there are still people that believe the whole "DLL Hell" myth. I hope I can shed some light on...
2
by: hazly | last post by:
I'm using SQL SERVER 2000 and in the process of establishing recovery guide. Tried to rebuild master using rebuildm.exe but the "Configuring Server" never ending. Then I tried to copy original...
27
by: cj | last post by:
I run this program and to exit click the X in the upper right corner. But apparently it isn't really ending the program. If I return to VB and make changes then try to rebuild the app it says the...
10
by: morangolds | last post by:
Hi, I've been having a problem with C++ Windows Forms apps not "ending" when you close the form window. I've searched about this problem all over the place and most searches have lead me to...
2
by: barry.edmund.wright | last post by:
Hi All, I want to build a Find Statement on the fly. The code below starting with 'This Code Works! is fine but as I said I want to build the Me!cboSelect1 & "=" & rs(Me!cboSelect1) portion of...
4
by: JamesB | last post by:
Hi, I need to trap a particular process starting or ending. I have done this using process.start from within my own app, but powers that be really want it to be seperate (i.e. my app should...
2
by: liorjj | last post by:
Hi, I need your help for some sporadic problem that I got during starting new process (C# 1.1). when I 'm starting new process on remote machine, my process starts properly but from some...
4
!NoItAll
by: !NoItAll | last post by:
I have a program that needs to access the files that are open by another program on the computer. When my application comes up I can easily see if the other application is running with the .net...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.