Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / July 2003

Tip: Looking for answers? Try searching our database.

Questions regarding windows service applications

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony Fountain - 31 Jul 2003 11:35 GMT
I have a windows service written in C#.  It's a simple service that will run
as our remote host listener.  First question: how do you install a service
to accept a command line parameter when the service starts?  Second
question, how do you install multiple instances of the same service (i.e.
SQL Server Agent)?  I've looked high and low and haven't found any samples
that assisted me.  Granted, I've been doing NET programming for a whole week
now and there's a lot I don't understand fully yet!

Thanks in advance,
Tony Fountain, MCSD
Tony Fountain - 31 Jul 2003 16:26 GMT
Ok, I have figured out a couple things:

Regarding parameters being passed to a service.  The parameters in the
property page of the service within the Service Control Manager do not
persist.  The parameters only get passed to the OnStart method if started
from the property page.  However, I did determine that by using a command
line parameter my Main procedure would get the information I needed to my
component.  Although I could not figure out how to install the service with
a command line parameter so I had to edit the registry entry to include the
it.

So now my questions are as follows:
1) Using the tools available in .NET, is it possible to create a service
installer class that takes a parameter.  This parameter would then be used
to specify the command line parameter for the service itself.
2) I still am unable to install the same exe as multiple services so any
insight would be appreciated.

Thanks in advance,
Tony Fountain, MCSD

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.