By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

Application.StartUpPath in a Windows service

P: n/a
Hi,

I want to get the application startup path of a windows service which is
available with Application.StartupPath in the System.Windows.Forms
namespace.

Since we can not use this namespace in a service, what is the best way to
get the same information that is the path of the EXE for the service?

Thank you for your help,

Mario

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
* "Mario" <bm*@online.nospam> scripsit:
I want to get the application startup path of a windows service which is
available with Application.StartupPath in the System.Windows.Forms
namespace.


\\\
Imports System.IO
Imports System.Reflection
..
..
..
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End Function
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

P: n/a
Thanks Herfried,

I will have to brush up on my research techniques... I did not look long
enough in the system.reflection class.

Mario

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> a écrit dans le
message de news:u5**************@tk2msftngp13.phx.gbl...
* "Mario" <bm*@online.nospam> scripsit:
I want to get the application startup path of a windows service which is
available with Application.StartupPath in the System.Windows.Forms
namespace.


\\\
Imports System.IO
Imports System.Reflection
.
.
.
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetExecutingAssembly().Location)
End Function
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.