开发者

Get domain name on ASP.NET Application_End events

开发者 https://www.devze.com 2023-01-19 19:10 出处:网络
How can you obtain the \'mydomain.com\' par开发者_运维百科t of a url within Application_End?There is not url to get because there is no user that read a page on application_end.

How can you obtain the 'mydomain.com' par开发者_运维百科t of a url within Application_End?


There is not url to get because there is no user that read a page on application_end.

Think some other way to find it - but why you search it for ? it is change ? don't you know it ? Do you have think to place it on a variable on web.config if have an application that you run it on different domains ?

What about the application path ?


I found the answer to my question. I had store the URL in a Shared Property. Shared instance properties are available within the Application_End event.

The application path will not suffice as I need a unqiue URI to determine which environment the application is running in (i.e. Development, Staging, Production, etc).

0

精彩评论

暂无评论...
验证码 换一张
取 消