fluentz
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 12/21/2008
-
Status: offline
|
can someone check this code and correct it for me, I'm Kinda Lost here
Sunday, December 21, 2008 1:10 PM
( permalink)
Imports SystemImports System.Diagnostics Imports System.ComponentModel Private Sub detect_Running() Dim procs As Process() Dim proc As Process Dim i As Integer = 0 ' get an array of all processes named "app" on server "serverName" procs = Process.GetProcessesByName("SMS") ' go through each proc named "app" and wait for it to exit For Each proc In procs i += 1 If i > 1 Then MsgBox("SMS Already running") proc.Kill() End If Next End Sub <--VB code-->
|
|
|
|
ebgreen
-
Total Posts
:
8227
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: offline
|
RE: can someone check this code and correct it for me, I'm Kinda Lost here
Sunday, December 21, 2008 2:40 PM
( permalink)
Well, let's start with the fact that this is VB.Net code, not VBScript. Are you trying to write VBScript code?
|
|
|
|
fluentz
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 12/21/2008
-
Status: offline
|
RE: can someone check this code and correct it for me, I'm Kinda Lost here
Sunday, December 21, 2008 4:45 PM
( permalink)
Ow... thats why it always pop-out an compilation error message. can it be converted into vbs code since i dont know how to compile vb.net code. I hv taken some effort in understanding this vbs and vb.net but somehow its really hard for me to understand. I really hope u can help me with this pronblem.
|
|
|
|
ginolard
-
Total Posts
:
1347
- Scores: 23
-
Reward points
:
0
- Joined: 8/11/2005
-
Status: offline
|
RE: can someone check this code and correct it for me, I'm Kinda Lost here
Sunday, December 21, 2008 7:53 PM
( permalink)
You will need to use WMI to iterate the Win32_Process namespace. Search the forums (or Google) for WMI and Win32_Process and you'll get plenty of examples
|
|
|
|