Try this:
if ( null == System.Web.HttpContext.Current ) // Add a reference to
System.Web.dll
{ //Non Web Environment
}
else
{ //Web Environment
}
It may be fudgy on the first page you load. (Aka, when testing, you set a
start up page to something like "default.aspx".
I'm not 100% sure this is the case, I'm just suggesting to be aware of it.
> Hi,
>
[quoted text clipped - 6 lines]
>
> Thanks
Mowie_X - 21 Mar 2006 03:14 GMT
Thanks a bunch. I found a similar kludgey solution. Using the
System.Diagnostics namespace.
I get the current process and try to get the MainWindowHandle.Title..
And then I see if it endswith "exe". Won't for a web app (will be
blank).