PC Review


Reply
Thread Tools Rate Thread

How can I call and pass parameter to Windows Service in VB.NET ?

 
 
SBh. via DotNetMonster.com
Guest
Posts: n/a
 
      5th Oct 2005
I already created a windows service that receive parameter in Sub GetValue ()
and I can registered and started service successfully. But unfortunately, I
don't know how to write program to call this windows service.

Anyone can help me and give me some example code, please ....

My windows service source code are as below :
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Protected Overrides Sub OnStart(ByVal args() As String)
GetValue (args(1), args(2))
End Sub

Public Shared Sub GetValue (ByVal Arg1 as String, ByVal Arg2 as String)
.... [ Calculate and return result ] ...
End Sub
 
Reply With Quote
 
 
 
 
learner
Guest
Posts: n/a
 
      6th Oct 2005
I am not quite sure how to handle this, but I think I have seen something
in msdn about this. I vaguely remember it mentioned safearray.

Hope you find the article under interop
"SBh. via DotNetMonster.com" <u14583@uwe> wrote in message
news:55622ecb70c46@uwe...
>I already created a windows service that receive parameter in Sub GetValue
>()
> and I can registered and started service successfully. But unfortunately,
> I
> don't know how to write program to call this windows service.
>
> Anyone can help me and give me some example code, please ....
>
> My windows service source code are as below :
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> Protected Overrides Sub OnStart(ByVal args() As String)
> GetValue (args(1), args(2))
> End Sub
>
> Public Shared Sub GetValue (ByVal Arg1 as String, ByVal Arg2 as String)
> .... [ Calculate and return result ] ...
> End Sub



 
Reply With Quote
 
 
 
 
Chris Petchey
Guest
Posts: n/a
 
      6th Oct 2005
In message <(E-Mail Removed)>, learner
<(E-Mail Removed)> writes
>I am not quite sure how to handle this, but I think I have seen something
>in msdn about this. I vaguely remember it mentioned safearray.
>
>Hope you find the article under interop
>"SBh. via DotNetMonster.com" <u14583@uwe> wrote in message
>news:55622ecb70c46@uwe...
>>I already created a windows service that receive parameter in Sub GetValue
>>()
>> and I can registered and started service successfully. But unfortunately,
>> I
>> don't know how to write program to call this windows service.
>>
>> Anyone can help me and give me some example code, please ....
>>
>> My windows service source code are as below :
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>
>> Protected Overrides Sub OnStart(ByVal args() As String)
>> GetValue (args(1), args(2))
>> End Sub
>>
>> Public Shared Sub GetValue (ByVal Arg1 as String, ByVal Arg2 as String)
>> .... [ Calculate and return result ] ...
>> End Sub

>
>

In your application:

myController = New ServiceController("MyService")
myController.ExecuteCommand(n)
'where n is an integer in range 128-255



This will appear as the arguement in the OnCustomCommand event of your
service




--
Chris Petchey
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pass parameter from windows service to windows application interna vishruth Microsoft C# .NET 3 2nd Jan 2008 06:02 PM
pass parameter from windows service to windows application vishruth Microsoft VB .NET 1 1st Jan 2008 08:22 PM
Pass Parameter to stored procedure in pass thru query SAC Microsoft Access Queries 7 11th Jul 2007 12:49 PM
Pass parameter to a parameter query from a data access page =?Utf-8?B?TWF0dA==?= Microsoft Access 0 11th Aug 2006 06:18 PM
error STOP:0x0000007B (parameter, parameter, parameter, parameter) robert35 Microsoft Access Getting Started 1 15th Dec 2004 04:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:16 AM.