How to Identify whether Dll is running From ASP.NEt or Window Appl

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I had Requirement to Autmatically format the Messages using HMTL if the
DLL is running from ASP.NET otherwise use standard Formating when DLL is
Executed from Windows application.

How can i achieve this.
 
N S S,
I'm not sure if there's a better way, but one way I believe you could tell
is to check if System.Web.UI.HttpContext is null. If it is, you aren't in a
web app.

Karl
 
How about checking the user account that the application is running under?
Most web apps run under the ASPNET user account.
 
Check System.Diagnostics.Process.GetCurrentProcess().ProcessName="w3wp"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top