473,387 Members | 1,502 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,387 software developers and data experts.

Help with this code _WIN32_Process

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/de...32_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
Nov 20 '05 #1
2 1309
You may want to have a look at the System.Diagnostics.Process class
instead...
"riverbr" <an*******@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.com...
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/de...32_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 String Dim strResult As String
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 ManagementObject
For Each strProcess In patch.Get

If strProcess("Caption") = StrProcessName Then

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

End If

Next
Return strResult
End Function
End Module

Thank you

John

Nov 20 '05 #2
Thank you
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Edward King | last post by:
Hi! I am trying to achieve the following: I have a number of help pages (in the format help_nn.php where nn=helpid). I want to be able to open a particular help page by calling the function...
2
by: sunfox | last post by:
Please help!! I have a difficulty in writing an assignment which is related to Visual C++ V6.0. Can anybody here assist me to write a program which is able to run under DOS? The program will be...
6
by: d.warnermurray | last post by:
I am doing a project for school that involves creating help files for a html authoring tool. If you could help me with answers to some questions it would really help. 1. What tasks do you expect...
4
by: dixie | last post by:
Help, I'm really out of my depth here (not unusual I hear you say :-). I have just installed HTML Help in an application. I told it in the Project Properties the path to the help file. I then...
1
by: Paul Rubin | last post by:
In Windows if you click the Help dropdown, IDLE launches a help window as it should. The help contents are included in the installation. In Linux, clicking Help launches a web browser, which is...
1
by: glenn123 | last post by:
Hi, i am just about out of time to produce a working jukebox which has to perform these functions: to play music files when a track is chosen from a list which when the user presses the change genre...
10
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably...
45
by: davy.zou | last post by:
I have started learning c++ and I need help. I need to write a program, the question is as follows. At a post office, there are a certain number of 2, 7, and 9cents stamps, now, given a total...
1
by: dsoutherland | last post by:
I am so new to ASP I'm not sure I am breathing. A company one of my clients deals with provides information over the web. They provided the ASP code for a default web site that is used to...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.