can someone check this code and correct it for me, I'm Kinda Lost here

Author Message
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)
0
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-->



 
#1
    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)
    0
    Well, let's start with the fact that this is VB.Net code, not VBScript. Are you trying to write VBScript code?
    "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
    Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
    http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2
      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)
      0
      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.
       
      #3
        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)
        0
        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
        Author of ManagePC - http://managepc.net

         
        #4

          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 1 guests.

          Icon Legend and Permission

          • New Messages
          • No New Messages
          • Hot Topic w/ New Messages
          • Hot Topic w/o New Messages
          • Locked w/ New Messages
          • Locked w/o New Messages
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2012 ASPPlayground.NET Forum Version 3.9