What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [solved] Help with code

[solved] Help with code
Author: Message:
Dox
Junior Member
**


Posts: 34
33 / Male / –
Joined: Oct 2005
O.P. [solved] Help with code
ok here is a code for VB.net

code:
Dim proc As Process
proc = Process.GetProcessesByName("name")
proc.Kill()

Now this code should work but when I put this code into an application it sais on the error list
quote:
Value of type '1-dimensional array of System.Diagnostics.Process' cannot be converted to 'System.Diagnostics.Process'.    C:\Documents and Settings\*********\Local Settings\Application Data\Temporary Projects\WindowsApplication1\Form1.vb    5    16    WindowsApplication1

And I have no idea what is going wrong, can anyone help me?

This post was edited on 12-21-2005 at 12:16 AM by Dox.
[Image: phpuser.jpg]

[Image: elixant%20user.gif]
Want 35% off all Elixant hosting packages? Drop me a PM
12-20-2005 09:57 AM
Profile E-Mail PM Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: Help with code
GetProcessesByName returns not a process but an array of process. As you need to get its elements you'd probably want to write
code:
For Each proc In Process.GetProcessesByName("name")
proc.Kill()
Next

:)
12-20-2005 10:16 AM
Profile PM Web Find Quote Report
Dox
Junior Member
**


Posts: 34
33 / Male / –
Joined: Oct 2005
O.P. RE: Help with code
Thaks alot Mnjul!

This post was edited on 12-21-2005 at 12:15 AM by Dox.
[Image: phpuser.jpg]

[Image: elixant%20user.gif]
Want 35% off all Elixant hosting packages? Drop me a PM
12-20-2005 10:32 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On