سؤال

I need to get access to the AppFriendlyName of a IIS application in the global.asa Application_Start event (classic ASP)

I am looking for the equivalent of HttpContext.Current.Request.ApplicationPath in the global.asax (ASP.NET)

Is there a way to do that ?

Thanks for your help !

Jerome Wagner

هل كانت مفيدة؟

المحلول

This is one way to do it..

path = Request.ServerVariables("URL")
position = InStr(2,path,"/",1)
Response.Write Right(Left(path,position-1),position-2) & "<br/>"

although it might not look good on the eyes ;)

UPDATE: Which of course doesn't work in Global.asa, since you can only use the Request object in Session_OnStart and Session_OnEnd. My bad, sorry.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top