Click here to Skip to main content
15,927,803 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Parse word document using vb6 Pin
Dave Kreskowiak28-Mar-07 15:17
mveDave Kreskowiak28-Mar-07 15:17 
QuestionGet Ascii/ Unicode Values Pin
Jonathan Gibbs27-Mar-07 23:54
Jonathan Gibbs27-Mar-07 23:54 
AnswerRe: Get Ascii/ Unicode Values Pin
MikeMarq28-Mar-07 6:50
MikeMarq28-Mar-07 6:50 
QuestionAdding Attributes to Control instances Pin
testy_proconsul27-Mar-07 22:33
testy_proconsul27-Mar-07 22:33 
QuestionSunday dates............. [modified] Pin
Member 387988127-Mar-07 22:10
Member 387988127-Mar-07 22:10 
AnswerRe: Sunday dates............. Pin
Tirthadip27-Mar-07 23:16
Tirthadip27-Mar-07 23:16 
AnswerRe: Sunday dates............. Pin
RichardBerry28-Mar-07 4:43
RichardBerry28-Mar-07 4:43 
QuestionAccess to properties of Windows Service Pin
mrzylinder27-Mar-07 21:35
mrzylinder27-Mar-07 21:35 
Hi all,

i am pretty new to VB and i got one problem for which i can't find any answer (sorry if i'm simply too blind and this was already answered). Maybe i also start with too difficult issues.

Anyway, i'll just ask.
Is there any way to access the properties of a service and to display these information in a ListView?

In more details:

I got an application developed as a Windows Service. This application can be used several times as a service which means several instances of this service can be created.
My problem is that i would like to display the path the original exe-file of the according service/instance in a ListView.

I already managed to get the name an current status of the according service but i can't manage to display the according path.

I'll put a part of the code here (please be forbear with me i'm beginner):


--------------------------------------------------------------------------------
ListView is called LstGenvSrv


'List
LstGenvSrv.View = View.Details
LstGenvSrv.Clear()

'Columns
LstGenvSrv.Columns.Add("Service", 300, HorizontalAlignment.Left)
LstGenvSrv.Columns.Add("State", 70, HorizontalAlignment.Center)
LstGenvSrv.Columns.Add("Registered File", 350, HorizontalAlignment.Left)

Dim RunningServicesXXX As ServiceProcess.ServiceController
Dim ServiceList As ListViewItem

For Each RunningServicesXXX In ServiceProcess.ServiceController.GetServices()
If RunningServicesXXX.ServiceName.StartsWith("XXX Service") Then
ServiceList = New ListViewItem(RunningServicesXXX.DisplayName)
ServiceList.SubItems.Add(RunningServicesXXX.Status.ToString)
I played around here but i am not able to... Sigh | :sigh:

LstGenvSrv.Items.Add(ServiceList)
LstGenvSrv.Refresh()

End If

Next

--------------------------------------------------------------------------------


In Column "Registered File" i'd like to display the path to the original exe-file for a better overview.
Is this easily possible? The only other possibility i know is by accessing the Registry. Searched through all items of ServiceProcess / ServiceProcess.ServiceController but did not find anyhing.
Some person told me to use some API-Functionality but i thought with .Net this is more or less obsolete.

Thanks for your help.

Mr.Zylinder


Questionexporting a crystal report in to Excel format Pin
indian14327-Mar-07 21:26
indian14327-Mar-07 21:26 
Questionproblem in vb.net Pin
bhawna_k27-Mar-07 21:26
bhawna_k27-Mar-07 21:26 
AnswerRe: problem in vb.net Pin
jack_claudine27-Mar-07 23:47
jack_claudine27-Mar-07 23:47 
AnswerRe: problem in vb.net Pin
Colin Angus Mackay28-Mar-07 0:34
Colin Angus Mackay28-Mar-07 0:34 
GeneralRe: problem in vb.net Pin
bhawna_k28-Mar-07 20:52
bhawna_k28-Mar-07 20:52 
GeneralRe: problem in vb.net Pin
Colin Angus Mackay28-Mar-07 20:55
Colin Angus Mackay28-Mar-07 20:55 
QuestionVB Report Designer Pin
jarth27-Mar-07 20:46
jarth27-Mar-07 20:46 
AnswerRe: VB Report Designer Pin
shanavaspi21-Sep-09 23:56
shanavaspi21-Sep-09 23:56 
QuestionHow to change paper orientation of default Printer ? Pin
ankprasanna27-Mar-07 20:33
ankprasanna27-Mar-07 20:33 
Question[Message Deleted] Pin
gubba27-Mar-07 20:28
gubba27-Mar-07 20:28 
GeneralRe: how to open a pop up window Pin
Guffa27-Mar-07 21:34
Guffa27-Mar-07 21:34 
AnswerRe: how to open a pop up window Pin
jack_claudine27-Mar-07 23:48
jack_claudine27-Mar-07 23:48 
Questiondeclare class Pin
nyakallo27-Mar-07 19:58
nyakallo27-Mar-07 19:58 
AnswerRe: declare class Pin
MikeMarq27-Mar-07 20:31
MikeMarq27-Mar-07 20:31 
Questiontimer tool Pin
nyakallo27-Mar-07 19:38
nyakallo27-Mar-07 19:38 
AnswerRe: timer tool Pin
Tirthadip27-Mar-07 23:22
Tirthadip27-Mar-07 23:22 
QuestionExcel and VB Pin
Osama12327-Mar-07 19:26
Osama12327-Mar-07 19:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.