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

Geting Window Service Path with out Interop

I need to get the path of a service in C#. Using C++, I can use
QueryServiceConfig() but I wish not to use Interop if I dont have to,
is there a way in C#?

thanks
Ralph

Nov 16 '05 #1
2 3956
Ralph,

This code should return the path & filename of the service executable, you
can use the Path class to parse out the lead-in path:

Process.GetCurrentProcess().MainModule.FileName

--Richard

"go*******@consiliumsoft.com" wrote:
I need to get the path of a service in C#. Using C++, I can use
QueryServiceConfig() but I wish not to use Interop if I dont have to,
is there a way in C#?

thanks
Ralph

Nov 16 '05 #2
You might also be able to use the entry point for the CLR, through the
static GetEntryAssembly method on the Assembly class (to get the entry
point), and then get the location of the assembly.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Richard" <Ri*****@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
Ralph,

This code should return the path & filename of the service executable, you
can use the Path class to parse out the lead-in path:

Process.GetCurrentProcess().MainModule.FileName

--Richard

"go*******@consiliumsoft.com" wrote:
I need to get the path of a service in C#. Using C++, I can use
QueryServiceConfig() but I wish not to use Interop if I dont have to,
is there a way in C#?

thanks
Ralph

Nov 16 '05 #3

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

Similar topics

17
by: Patrick | last post by:
I am almost certain that I could use HTTP Post/Get to submit XML Web Service call (over SSL as well, if using Version 3 of MSXML2) from an ASP Application? However, would I only be able to call...
4
by: riki | last post by:
hi, i've asked this question before and didn't get an answer...maybe i didn't explain it well so i'll try again... -------------------------------------- main.html i'm calling popUp like...
6
by: Usman | last post by:
Hi I have a window service written in C#. I have another application that requires a lengthy process to be performed like taking backup. How can I make this lengthy process be performed by...
5
by: Nate | last post by:
We are attempting to make a request to a web service (we will refer to it as XXXServices) hosted on a Web Logic server from a C# SOAP client. The server responds with a 401 Unauthorized error...
2
by: Tim Reynolds | last post by:
Team, We need some guidance here. We are developing a web service to expose to external system. We are not sure which is the best path to take. We have multiple input fields required and a few...
9
by: =?Utf-8?B?UG90c2FuZw==?= | last post by:
Hi, I have a window service program created in c#. The window service program is installed and running. In the mean time, I have another c# application, I would like to know if there is a way to...
0
by: henkya | last post by:
Language Used: C# Project Typed: Setup Project (for .NET Window Service) Hi Bump into this issue and seriously have a hunch that this is a bug in the .NET setup project. These are the scenario:...
41
by: pbd22 | last post by:
Hi. I know my windows service works when i run it in debug mode on my dev machine. It also works in release mode on my dev machine. But, when I move the service to a production server, it...
16
emibt08
by: emibt08 | last post by:
Hello fellow programmers. I am working on a project that is a windows service. It should open an excel file and read it and it worked good on WinXP SP2 w/ Office 2003. Now the customer upgraded to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.