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