Help with this code _WIN32_Process

G

Guest

Hello

As you can probably see from my code, I'm new to the Program world and VB.NET is my first language. I'm trying to use the Method from the WIN32_Process, but I don't know how to use it. I tried several syntax (could not figure it out). I Tried the following link below

http://msdn.microsoft.com/library/d...i/terminate_method_in_class_win32_process.asp (I could not figure out the syntax)

and Example in VB.NET would really help. here is the code

Function FTerminate(ByVal ComputerName As String, ByVal StrProcessName As String) As Strin
Dim strResult As Strin
Dim objectQuery As New System.Management.ObjectQuery("Select * From Win32_Process"
Dim scope As New System.Management.ManagementScope("\\" & ComputerName & "\root\cimv2"
scope.Connect(
Dim patch As New ManagementObjectSearcher(scope, objectQuery
Dim strProcess As ManagementObjec
For Each strProcess In patch.Ge

If strProcess("Caption") = StrProcessName The

_________________> "TERMINATE METHOD HERE"*********

End I

Nex
Return strResul
End Functio
End Modul

Thank yo

John
 
C

CJ Taylor

You may want to have a look at the System.Diagnostics.Process class
instead...


riverbr said:
Hello,

As you can probably see from my code, I'm new to the Program world and
VB.NET is my first language. I'm trying to use the Method from the
WIN32_Process, but I don't know how to use it. I tried several syntax (could
not figure it out). I Tried the following link below:http://msdn.microsoft.com/library/d...i/terminate_method_in_class_win32_process.asp
(I could not figure out the syntax)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top