Home All Groups Group Topic Archive Search About

identify when running as a service

Author
8 Sep 2006 1:19 AM
Jeff Jarrell
Is there a programmatic way to identify when code is running as a service?

Author
8 Sep 2006 9:33 AM
Phill W.
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.
Author
10 Sep 2006 3:34 AM
Jeff Jarrell
that should do the trick.
thanks,
jeff

Show quoteHide quote
"Phill W." <p-.-a-.-w-a-r-d@o-p-e-n-.-a-c-.-u-k> wrote in message
news:edrdch$fu9$1@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.