CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: FoxPro

Retrieving the Virtual in a Web Connection Request

404 Views
Copy Code Show/Hide Line Numbers
************************************************************************
* wwProcess :: GetUrlBasePath
****************************************
***  Function: Method responsible for establishing the base path
***            for this application. 
***    Assume:
***      Pass:
***    Return:
************************************************************************
FUNCTION GetUrlBasePath()
LOCAL lcPath
 
IF !EMPTY(THIS.cUrlBasePath)
   RETURN this.cUrlBasePath
ENDIF   
 
*** Try to read ADSI Virtual Path setting from IIS
lcPath = Request.ServerVariables("APPL_MD_PATH")
* /LM/W3SVC/1/ROOT/wconnect
IF !EMPTY(lcPath)
    lcPath = Extract(lcPath,"ROOT/","","",.t.)
    IF EMPTY(lcPath)
       lcPath = "/"
    ELSE
        lcPath = "/" + lcPath + "/"
    ENDIF         
    this.cUrlBasePath = lcPath
    RETURN lcPath
ENDIF
 
TRY 
   THIS.oConfig = EVALUATE("THIS.oServer.oConfig.o" + this.Class)
   THIS.cUrlBasePath = THIS.oConfig.cVirtualPath
CATCH
ENDTRY
 
RETURN THIS.cUrlbasePath
ENDFUNC
*  wwProcess :: GetUrlBasePath
by Rick Strahl
  December 16, 2009 @ 2:43pm
Tags:

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate