How to know if i use ASP.NET or Winforms in a DLL

  • Thread starter Thread starter smoog
  • Start date Start date
S

smoog

Hi,

I have one dll that can be called by a Winforms or an Asp.Net
application, and i would like to know how can i find this environment
??

In fact i want to know the SartupDirectory of these application..I
think Server.MapPath is ok for Asp.Net ( WebServices) and
Application.StartupPath for Winforms ?
 
Check if

if (HttpContext.Current != null)
{
// Its a web app [Can be web service or web site]
}
 
Thank u !

Winista a écrit :
Check if

if (HttpContext.Current != null)
{
// Its a web app [Can be web service or web site]
}

smoog said:
Hi,

I have one dll that can be called by a Winforms or an Asp.Net
application, and i would like to know how can i find this environment
??

In fact i want to know the SartupDirectory of these application..I
think Server.MapPath is ok for Asp.Net ( WebServices) and
Application.StartupPath for Winforms ?
 

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