determine programatically: Web or Windows?

  • Thread starter Thread starter dje
  • Start date Start date
D

dje

How do I determine if the current process is a Web Application
or Windows Application? I've tried:
System.Diagnostics.Process process=System.Diagnostics.Process.GetCurrentProcess();
but it produces:
Couldn't get process information from remote machine.
Using W2K.
 
I am not sure whether this is "the proper" method, but you can try to check
the value of System.Web.HttpContext.Current and if it is null, you can
conclude that it is not a Web application.

Alek
 
Thanks Alek; System.Web.HttpContext is undefined for a windows app so
that didn't quite work. "AppDomain.CurrentDomain.FriendlyName" seems
to work for me.
 
Back
Top