473,654 Members | 3,033 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Geting Window Service Path with out Interop

I need to get the path of a service in C#. Using C++, I can use
QueryServiceCon fig() 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 3970
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.GetCurr entProcess().Ma inModule.FileNa me

--Richard

"go*******@cons iliumsoft.com" wrote:
I need to get the path of a service in C#. Using C++, I can use
QueryServiceCon fig() 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 GetEntryAssembl y 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.co m

"Richard" <Ri*****@discus sions.microsoft .com> wrote in message
news:EF******** *************** ***********@mic rosoft.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.GetCurr entProcess().Ma inModule.FileNa me

--Richard

"go*******@cons iliumsoft.com" wrote:
I need to get the path of a service in C#. Using C++, I can use
QueryServiceCon fig() 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
14780
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 web-service in a an asynchronous mode (with a callback function)? If so, how?
4
1673
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 window.open('/path/pic.jpg','popUp','toolbar=no, location=no etc.') now...all pics don't have the same width and height so i don't wanna fix manualy width and height for each pic... --------------------------------------
6
2488
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 window service in such a manner that my application may invoke the process. Is there any way that I can call some method written in window service apart from Start, Stop, Pause etc from my application or firing some custom event to the window service...
5
12502
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 (that appears in plain text), and causes the client to crash. This C# code has been deployed both as an ASP.NET application and a WinForms app, each of which produced the same result. Further, moving the clients from a Windows XP machine to Windows...
2
1966
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 output fields. We are thinking to either 1) Make all input fields one class and have one parameter for our web service of this object type and make all output fields a second class and have return type of our web method return an object of this...
9
2480
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 find out in this c# application where (the complete path)the window service program is running from. Can someone provide the sample code? Thanks.
0
1905
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: - I have an existing Window-Service application written in C#, and was build following the general deploying Window-Service guideline (the Win-Service project has a Installer class that have ServiceProcessInstaller & ServiceInstaller that...
41
11630
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 exits immediately with a start/stop/nothing to do error. What could be wrong?
16
34124
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 Windows Vista 32-bit w/ Office 2007 and keep getting the following error: -------------------------------------------------------------------------------------------------- SOURCE: Microsoft Office Excel MESSAGE: Microsoft Office Excel cannot...
0
8370
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8283
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8704
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5620
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.