Subject: RE: Get command arguments in Windows Service
Date: Mon, 8 Sep 2003 09:16:28 -0700
Lines: 56
Message-ID: <
[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcN2JI7qoR2H+AzdR9ucVL9fs0/JAw==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107680
NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
X-Tomcat-NG: microsoft.public.dotnet.general
Thank you for your reply. However, your solution doesn't
work. I've already tried this. I think a Start parameter
of Windows Service doesn't pass any argument to
GetCommandLineArgs method.
Eric
-----Original Message-----
Hi Eric,
You may try the Environment.GetCommandLineArgs Method.
Here is a helpful link.
Did I answer your question?
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure!
www.microsoft.com/security
This posting is provided "as is" with no warranties and
confers no rights.
--------------------
Content-Class: urn:content-classes:message
From: "Eric Chong" <
[email protected]>
Sender: "Eric Chong" <
[email protected]>
Subject: Get command arguments in Windows Service
Date: Fri, 5 Sep 2003 11:14:28 -0700
Lines: 9
Message-ID: <
[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcNz2Yt3Dhmj8jm/RlO1ml5VJWd4bw==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.general:107449
NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
X-Tomcat-NG: microsoft.public.dotnet.general
I created a Windows Service in C# that requires to get
passed command arguments like a Console App. I noticed
that there is an option "Start parameters" text box in
the property of a Windows Service in MMC. Is there any
way to get arguments using this option? If possible,
what
framework method should I use to get an arguement?
Thanks in advance.
Eric
.