Generic way to extract filename from path independent on platform

P

PeterB

Hello!

I'm using the following method to retrieve the filname from a full server
path:

<%
sub getfname(strPath)
Dim fName
fName = Mid(strPath,InStrRev(strPath,"\")+1)
'fName = strPath
Response.Write( fName )
end sub
%>

However this only works on Windows systems as it checks for backslash. Is
there a more generic way to do this, or should I check for both backslash
and slash in the path?

thanks,

Peter
 
P

PeterB

A / perhaps? Unix notatio, there are Unix/Linux modules for .NET out there
so it would be possible to run an ASP site on a linux-machine...

/ Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top