PC Review


Reply
Thread Tools Rate Thread

Application.StartUpPath in a Windows service

 
 
Mario
Guest
Posts: n/a
 
      13th Jul 2004
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



 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      13th Jul 2004
* "Mario" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
Mario
Guest
Posts: n/a
 
      14th Jul 2004
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]" <hirf-spam-me-(E-Mail Removed)> a écrit dans le
message de news:(E-Mail Removed)...
> * "Mario" <(E-Mail Removed)> 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/>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.StartupPath on Windows 7 Joe Cool Microsoft C# .NET 3 6th Jan 2010 04:58 PM
PRoblem with System.Windows.Forms.Application.StartupPath when running test project Patrik Microsoft Dot NET Framework 11 5th Sep 2008 06:52 AM
Application.StartupPath Rick Microsoft VB .NET 4 30th Oct 2006 01:28 AM
chm and application.startuppath al jones Microsoft VB .NET 2 2nd Oct 2006 04:42 PM
Application.StartupPath =?Utf-8?B?cm9kY2hhcg==?= Microsoft VB .NET 4 10th Apr 2005 12:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:12 PM.