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

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

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
Nov 21 '05 #1
2 2987
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

Nov 21 '05 #2
In message <uh**************@TK2MSFTNGP10.phx.gbl>, learner
<le*****@nomail.nil> 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
Nov 21 '05 #3

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

Similar topics

1
by: jaya | last post by:
Hi, I am using asp.net to pass parameters from .aspx page to my Microsoft reporting service. My .aspx page has checkbox. If it is checked it the chekbox should pass value =0 to my report <INPUT...
2
by: Bruno van Dooren | last post by:
Hi, i need to create a .NET class that will provide the same functionality as the windows 'run as' command. it seems that this code is not available in the .NET framework. I have found an...
3
by: eedych | last post by:
Hi all, as a newbie of C#, I am rather surprised when I saw that the method of System.ServiceProcess.ServiceController - ExecuteCommand(int command) - has only one parameter. What shall I do if I...
2
by: elora_c | last post by:
I'm making a call to a webservice from my ASP.NET page. The web application has anonymous access turned off and Integrated Windows auth turned on. The web.config has <identity impersonate=true>. ...
5
by: Kurt Van Campenhout | last post by:
Hi, I am trying to get/set Terminal server information in the active directory on a windows 2000 domain. Since the ADSI calls for TS don't work until W2K3, I need to do it myself. I'm fairly...
0
by: Mike S | last post by:
I've seen examples of using the CallWindowProc Windows API function to call functions through their addresses in VB6 -- a clever workaround to emulate C-like function pointer semantics. A...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
1
by: =?Utf-8?B?RGFtaXIgRGV6ZWxqaW4=?= | last post by:
Hi. I have to implement an Java Axis2 web service client in .NET WCF as well a web service to witch a Java Axis2 client will connect. I would like to provide user identification using...
4
by: =?iso-8859-1?B?S2VyZW0gR/xtcvxrY/w=?= | last post by:
Hi, i am looking for an example that shows how to implement a COM Interface (with events) and pass it to a Windows API Call via pointer. Since this is really new to me, i dont know where to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.