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

Writing a service Q: how to get the parameter from...

When I start my service I want to pick up a parameter from Start Parameters
box (in the service control screen). I cannot find the proper method to get
this string. It has to be easy but I cannot find the command(s).

Thanks.
Nov 20 '05 #1
6 1215
On Mon, 5 Apr 2004 12:11:30 -0400, Roger Twomey wrote:
When I start my service I want to pick up a parameter from Start Parameters
box (in the service control screen). I cannot find the proper method to get
this string. It has to be easy but I cannot find the command(s).

Thanks.


The OnStart method has an args() parameter. Have you looked at that?
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #2
I have, I can 'sort of' understand this.

It seems the args come through as an array however when the array is created
it appears to parse on more than one character.

So far I have found it splits on both the space and the semi-colon ;

If it splits on more elements (comma, colon, others??) it seems to make
using the string a bit more complicated. Currently I loop through the array
and concatonate string so that I can split it the way I want.

That seems a bit odd to me.

Is that the way it is supposed to work?

<Thank you by the way, I did not notice the args() in the onstart until you
mentioned it.>
"Chris Dunaway" <dunawayc@_lunchmeat_sbcglobal.net> wrote in message
news:om*****************************@40tude.net...
On Mon, 5 Apr 2004 12:11:30 -0400, Roger Twomey wrote:
When I start my service I want to pick up a parameter from Start Parameters box (in the service control screen). I cannot find the proper method to get this string. It has to be easy but I cannot find the command(s).

Thanks.


The OnStart method has an args() parameter. Have you looked at that?
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.

Nov 20 '05 #3
On Mon, 5 Apr 2004 12:11:30 -0400, Roger Twomey wrote:
When I start my service I want to pick up a parameter from Start Parameters
box (in the service control screen). I cannot find the proper method to get
this string. It has to be easy but I cannot find the command(s).

Thanks.


The OnStart method has an args() parameter. Have you looked at that?
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #4
I have, I can 'sort of' understand this.

It seems the args come through as an array however when the array is created
it appears to parse on more than one character.

So far I have found it splits on both the space and the semi-colon ;

If it splits on more elements (comma, colon, others??) it seems to make
using the string a bit more complicated. Currently I loop through the array
and concatonate string so that I can split it the way I want.

That seems a bit odd to me.

Is that the way it is supposed to work?

<Thank you by the way, I did not notice the args() in the onstart until you
mentioned it.>
"Chris Dunaway" <dunawayc@_lunchmeat_sbcglobal.net> wrote in message
news:om*****************************@40tude.net...
On Mon, 5 Apr 2004 12:11:30 -0400, Roger Twomey wrote:
When I start my service I want to pick up a parameter from Start Parameters box (in the service control screen). I cannot find the proper method to get this string. It has to be easy but I cannot find the command(s).

Thanks.


The OnStart method has an args() parameter. Have you looked at that?
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.

Nov 20 '05 #5
On Mon, 5 Apr 2004 14:53:29 -0400, Roger Twomey wrote:

So far I have found it splits on both the space and the semi-colon ;


I did not know that it split on the semi colon. I assumed that it split on
a space character. If you have parameters that may include spaces (such as
a filename), you can enclose the paramter in quotation marks and it will be
split properly into the args array.

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #6
On Mon, 5 Apr 2004 14:53:29 -0400, Roger Twomey wrote:

So far I have found it splits on both the space and the semi-colon ;


I did not know that it split on the semi colon. I assumed that it split on
a space character. If you have parameters that may include spaces (such as
a filename), you can enclose the paramter in quotation marks and it will be
split properly into the args array.

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #7

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

Similar topics

6
by: Roger Twomey | last post by:
When I start my service I want to pick up a parameter from Start Parameters box (in the service control screen). I cannot find the proper method to get this string. It has to be easy but I cannot...
0
by: DaveS | last post by:
I have a web service that returns one parameter which is defined as a string. In this string is returned an XML document (due to the fact that I have a large amount of data to pass back to the...
1
by: amirmira | last post by:
I would like to set command line arguments to a service at install time. I need to do this because I need to get information from different registry locations depending on my command line argument....
2
by: SQLScott | last post by:
I know that passing variables "ByRef" to a web web service is permitted, but what I am expreriencing is quite odd. If I take out my ByRef parameter from the method of my web service, i can step...
3
by: Pratcp | last post by:
Hello, I have an asp.net Web app in vb.net trying to call a C# web service which takes a reference parameter. I tried a simple C# web app to call the Web service and it works perfectly. However,...
10
by: amazon | last post by:
Our vender provided us a web service: 1xyztest.xsd file... ------------------------------------ postEvent PostEventRequest ------------------------------------- authetication authentication...
11
by: Joseph Geretz | last post by:
I've been looking at two approaches for the maintenance of Session state for a Web Service application. One approach uses the old familiar Session object which I've used in the past for Web...
3
dmjpro
by: dmjpro | last post by:
plz send me a good link which can clearify me how the J2EE framework works i want the details information .... plz help thanx
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:
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
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: 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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.