Determining if an app is a web app or a windows app

Hi all,

 I'm writing a generic utilites class and one of the methods needs to get the physical path of the application.

I know Server.MapPath("~") gets the server path of the app for windows and also that Application.ExecutablePath gets the path for windows app.

Now how would i determine which app is a windows app or a web app?


Thanks in advance.

7/28/2008 7:27:41 PM 7760 articles. 0 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 9

add a reference to system.web and then do the following

  if (System.Web.HttpContext.Current == null)
                //"we are are not a web app"

If you get the answer to your question, please mark it as the answer.
7/28/2008 7:45:56 PM
And when HttpContext is NOT null, I'd probably use HttpContext.Current.Request.PhysicalApplicationPath instead... of resolving the squiggly. It kind of feels less like a hack to me ^^
7/28/2008 7:54:04 PM

Similar Artilces:

Web app to Windows app.
I’m new at this so please bear with me. In theory, is it possible to create a .net web application that can talk to a .net windows application? What I would like to accomplish is to use a .net web app to talk to Microsoft’s Windows Media Batch Encoder. Any comments are appreciated. Tome...

VB.NET Data Grid, windows app to web app
Is it possible to make a Web Application Data Grid element with identical functionality as a Windows Application Data Grid? When I run the code as a windows application, it allows me to make direct edits of each database record through the data grid. When I run the code through a browser, however, it only displays the records. This is the code:Any suggestions? Inherits System.Web.UI.Page Dim connstr As String = "data source=SERVER;initial catalog=DB;user id=USER;password=PASSWORD;" Dim sqlStr As String = "SELECT * FROM Users" Dim dt As New DataTable Private Sub btnLoad_Click(B...

connect web app to windows app
Hello folks.i want to connect web application( to desktop application and transfer data but when some events triggered from user web browser. (for example live support packages)i know it can be done in win applications with sockets but I'm not sure for applications.Any advice/help greatly appreciated.   oh, no body knows? It is possible to wire into events on the client, but this is outside the scope of ASP.Net.  Presuming your Desktop APP is a dotnet app this is a Windows Forms question, consider posting here

Web app calling a windows app
How do I get my web app to open a windows program on the server side using a button click evenT? First off you'd have to give the ASPNET user execute priviledges on the server which I don't think that you want to do.NC... Hi,If the windows Program is of exe format then try with the following codeTry to include the exe in to your web folder or the ASP.NET process needs to have permissions to access the external applicationstring filePath = Server.MapPath(@"ApplicationName.exe"); System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo(filePath , "Arguments of th...

Web app called by windows app...
Hey everyone,Well I have not worked with .Net at all regarding windows apps etc. What I have is a website with a secure login. My customer wants all his employees to access the secure site without knowing the user name and password, as there is a high turn over rate. Is there a good way to accomplish this?My thoughts were possibly to create a windows app they could download and execute which would basically pass encrypted parameters to our secure login page, therefore logging them in and no one being the wiser.Is this poosible?Is there a better way?Hope I explained it well!Thank youJorellz...

Web app and Windows Forms app
I've done a lot of .NET web development, but I'm trying to write a Forms App.  I'm trying to populate a GridView Control with a simple "SELECT *" query, but I'm not having any luck.  I keep getting this error:"An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections." I enabled remote connections on my SQL Server, then as a test I built a local web app that conne...

running windows apps in web apps
Hi all, just to check it out if there is a way to run a windows app when a button in a web app is clicked.? Hi, you're referring to what's known as smart clients. You can place a windows forms executable in the virtual folder of your webserver (IIS of course ), then create a hyperlink in your webform to the executable. If the enduser has the correct .NET framerwok installed he/she can execute the application on his/her pc. Another trick, one I recently used BTW, is to embed a winforms user control, build as .dll file, in a webform. An example can be found here: Hosting a Windows Contr...

convert java web app 2 .NET web app
Hi, i am able to convert java console app to .NET console app.but i am unable to convert java web based application to .NET web based application. can u give me some idea as to how to convert that. Thanks in advance,nizam. I believe the technical phrase is.. rtfm?  lol.  you're going to have to do it the hard way.  JSP operates on a different theory of web development than 2.0Kay - Code to live, but Live to code. Try these two links for sample code and free book from Microsoft, ...

Send by Windows App - Receive by Web App
Ok. I've read something about Web Services (ex. want to make:- Windows Application which after click the button would send string to the web page - example: "Server is online" or simply Boolean "True".- Web Application will receive this string and if is "True" than on the page is displaying information that this is true till the windows application will close down.How can I get simply that what I want ?I have a problem, cause I don't know how to receive information form Win App and make to display results on other sites.  OK, let me make sure I...

C# Windows App to C# Web App
I have a situation that reverses says what is the best way to convert a windows app to a web app?Any thought? It´s hard to say when you don´t tell us how you have built your application. Do you use n-tier? If you do, it´s not that hard to convert to a web form because you can use the same classes with no/a little changes on the BLL & DAL.Mikael Söderström Check if any of the following artilces will help you;converting windows forms to web forms

conversion of windows app to web-enable apps
guys i know this may sound strange but a friend of mine told me that he saw a software/application that can somehow convert windows application into a web-enabled application or at least make these windows applications accessible to the internet without rewriting the whole system... is there such a thing? Maybe he was talking about Smart Client applications?  These are still windows applications, but connect to the internet via such mechanisms as web services for data exchange.Terri MortonEngagement Manager, NeudesicHow to ask a question mr. tmorton i found something i dont ...

How to call a web app from a windows deskstop app?
 Hello,I need to call a web page from a windows application and I'm not sure how to approach this. Can anyone give me some pointers? Thanks! What do you mean by calling a webapp. Do you just want to load a website or web page in your windows application? If yes, then look into WebBrowser control. FYI, this is an ASP.NET forum.Thanks,MaxLet Me Google That For You! Hi i know is not the same but there is a thread that get close to what you need :"Mark As Answer" If my reply helped you --...

Error while converting visual studio 2003 App to visual studio 2005
When I try to convert a visual studio 2003 web application to visual studio 2005 I get the error message "Unable to open the Web. The Web server does not appear to have the FrontPage server extensions installed.". Are front page server extensions required for visual studio 2005 apps? Thanks, NeelG Front page server extensions are not required for visual studio 2005 applications.The error has nothing to with Frontpage extensions.its just that the conversion wizard failed.See for conversion steps.Dont get confused in s...

VS 2005 Win App Vs Web App
I am about to start writing an application that will monitor the locations of our golf carts, how this works is when a cart gets close to a hole or other locations on our course it will update our database with it's location. once the database is updated the change will be sent to the clients screen showing the cart in it's new location "The clients display is graphical showing a map on the course and the carts location on the course". Please keep in mind that this app will also allow the user to assign available technicians to work on carts needing maintenance and it will keep track of main...

Web resources about - Determining if an app is a web app or a windows app -

Complementarity determining region - Wikipedia, the free encyclopedia
Complementarity determining regions ( CDRs ) are part of the variable chains in immunoglobulins (antibodies) and T cell receptors , generated ...

Determining Business Value
... What I will attempt to do in this blog is provide a model for looking at business value focusing on the portfolio [...] The post Determining ...

Determining Sea Level
It’s much more complicated than you think:

Mac notebooks: Determining battery cycle count
For computers with Mac OS X v10.4.x or later, use the steps in this article to determine the cycles on your Mac notebook's battery.

Determining Valuation Multiples
Last week on MBA Mondays, I talked about valuing an internet marketplace business. In that post, I talked about using 1x gross marketplace transactions ...

An alternative method for determining defensive WAR
... that David Wright is a scratch defender at third, but the data produces blips from year to year, maybe the data isn't right. Maybe when determining ...

NBA Preseason Determining Destinies for Houston Rockets Bench
HOUSTON—It’s the night of Oct. 13, 2014, and the Houston Rockets are hosting the Phoenix Suns . Dwight Howard and James Harden are sitting this ...

"The federal health care exchange is incorrectly determining that some people are eligible for Medicaid ...
"... leaving them with little chance to get the subsidized insurance they are entitled to as the Dec. 23 deadline for enrollment approaches." ...

... invested by dousing it in gasoline and then applying a lit sparkler. Best, Doug For the rest of America, there's this: MT @darmercurio: Determining ...

Resources last updated: 12/19/2015 7:27:03 PM