2010-08-11 23 views

risposta

0

ho trovato un modo per farlo utilizzando alcune variabili del server. Qualcuno può garantire eventuali bug in questo modo?

function getRoot() 


pathinfo=Request.ServerVariables("PATH_INFO") 

Set myRegExp = New RegExp 
myRegExp.IgnoreCase = True 
myRegExp.Global = True 
myRegExp.Pattern = "^(/\w*/).*" 
' Pop up a message box for each match 
getRoot = myRegExp.Replace (pathinfo, "$1") 


end function 
+0

Si aveva 1 problema, con la regex, ora avete 2;) – mathieu

5

Hai provato

<%= Server.MapPath("/") %> 
3

Usa Request.ServerVariables("APPL_MD_PATH") o Request.ServerVariables("APPL_PHYSICAL_PATH").

+1

'Request.ServerVariables (" APPL_PHYSICAL_PATH ")' ha funzionato per me. Grazie! –