473,398 Members | 2,343 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,398 software developers and data experts.

determine programatically: Web or Windows?

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.GetCurrentProce ss();
but it produces:
Couldn't get process information from remote machine.
Using W2K.
Nov 15 '05 #1
3 1685
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

"dje" <de@networld.com> wrote in message
news:d7**************************@posting.google.c om...
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.GetCurrentProce ss(); but it produces:
Couldn't get process information from remote machine.
Using W2K.

Nov 15 '05 #2
dje
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.

"Alek Davis" <alek_xDOTx_davis_xATx_intel_xDOTx_com> wrote in message news:<OE**************@TK2MSFTNGP09.phx.gbl>...
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

"dje" <de@networld.com> wrote in message
news:d7**************************@posting.google.c om...
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.GetCurrentProce ss();
but it produces:
Couldn't get process information from remote machine.
Using W2K.

Nov 15 '05 #3

Well, then use System.Web.HttpContext for your check <g>...

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/blog/
----------------------------------
Making waves on the Web
"dje" <de@networld.com> wrote in message
news:d7**************************@posting.google.c om...
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.

"Alek Davis" <alek_xDOTx_davis_xATx_intel_xDOTx_com> wrote in message

news:<OE**************@TK2MSFTNGP09.phx.gbl>...
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

"dje" <de@networld.com> wrote in message
news:d7**************************@posting.google.c om...
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.GetCurrentProce ss();
but it produces:
Couldn't get process information from remote machine.
Using W2K.

Nov 15 '05 #4

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

Similar topics

0
by: Buddy Ackerman | last post by:
I need to programatically determine the directory that the application/service is running from. If I use Environment.CurrentDirectory it returns the System32 directory. Is there anyway to get this...
4
by: Br | last post by:
We're using an Access2000 ADP with an SQL2000 back-end. Because SQL2000 was released after Access2000 you need to be running Access2000 SP1 (2 or 3) for it to work properly. Is there an easy way...
3
by: dave | last post by:
How do I programatically determine the enabled or disabled status of AD accounts? I have queried the userAccountControl key, but all I get back is an int, and it seems to be the same for enabled...
1
by: Tarundeep Singh Kalra | last post by:
How to programatically determine the .NET Framework Version - -- Tarun ********************************************************************** Tarundeep Singh Kalra...
1
by: Tim Pacl | last post by:
I am building a custom server control. I need to determine whether the page the custom control resides in is in flow layout or grid layout. Because I am doing this from the server control, I need...
4
by: vickaiser1 | last post by:
I am creating a setup project for an application and need to edit the Metabase.xml file during setup. Does anyone know of a way to stop and then restart services programatically before and after I...
3
by: Danny Miller | last post by:
Hi there, I've got a web app that uses impersonation and makes calls to a SQL Server backend. I'd like to be able to automate the setting of database security for the web app upon deployment....
10
by: Raffi | last post by:
Hi, I'm looking for a way using JavaScript to determine if the browser window has an address bar. Thanks, Raffi
4
controlbox
by: controlbox | last post by:
Does anyone know a way to programatically determine the Windows Account IIS is using from inside an ASP or ASP.Net page?
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
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...

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.