How determine if application is web application

后端 未结 5 1425
轻奢々
轻奢々 2020-11-29 06:39

In a core assembly, which is run both in a windows service, and in a web application, I need to store information per user session. The service will have a single user sessi

5条回答
  •  無奈伤痛
    2020-11-29 06:56

    if(HttpRuntime.AppDomainAppId != null)
    {
      //is web app
    }
    else
    {
      //is windows app
    }
    

提交回复
热议问题