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

identify when running as a service

Is there a programmatic way to identify when code is running as a service?
Sep 8 '06 #1
2 948
Jeff Jarrell wrote:
Is there a programmatic way to identify when code is running as a service?
I've been using this ...

If System.Environment.UserInteractive = False Then
' Service Mode '
Else
' something else
End If

HTH,
Phill W.
Sep 8 '06 #2
that should do the trick.
thanks,
jeff

"Phill W." <p-.-a-.-w-a-r-d@o-p-e-n-.-a-c-.-u-kwrote in message
news:ed**********@south.jnrs.ja.net...
Jeff Jarrell wrote:
>Is there a programmatic way to identify when code is running as a
service?

I've been using this ...

If System.Environment.UserInteractive = False Then
' Service Mode '
Else
' something else
End If

HTH,
Phill W.

Sep 10 '06 #3

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

Similar topics

0
by: Martijn Remmen | last post by:
I have developed a service which exposes a COM object. This service is running perfect on Windows 2000 Server and Windows 2000 Professional under the SYSTEM account. When the service is...
0
by: Marko | last post by:
Hello! We are deweloping a web service wich does some processing depending on wich user called it. The problem is that the web service has to know wich user made a call to it. In IIS the...
4
by: Iftikhar Hussain | last post by:
Hello Everyone Nice to be back here, well all u guys have helped in past & now I would like a favor again. first what i want to develop is as follows: An application for rescue station, where...
6
by: Frank Meng | last post by:
Hi. Can system service identify current active user with .net? I need current active user's logon name from system service. I tried WindowsIdentity.GetCurrent().Name and it gave me "NT...
1
by: Christopher Attard | last post by:
Hi, I'm getting a list of running processes on a machine using Process.GetProcesses(). Can I identify programmatically which of these processes is running as a service. 10x in advance. Chris
1
by: N S S | last post by:
I have a need to identify the Environment under which the DLL is Executing. The same DLL may be running under or from IIS,Webservice, windows service or remoting. Any ideas how to find it ?
3
by: Michel | last post by:
Hi, I wrote an app in .Net and I whant only 1 instance of this app open for the user; the user open my app, do some works and try to open another instance of my app, I whant to show a message to...
3
by: Jay | last post by:
Hey There, Is it possible to get an unique identifier for a desktop that a particular app is running from, from a service? If there are two instances of the app running on different desktops (one...
22
by: robertgregson | last post by:
Using C#, .NET3.5, Visual Studio 2008 and WCF on Windows VISTA SP1, I have written a service, service host (as a C# console application) and a client. The service uses...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.