当前位置:编程学习 > asp >>

asp 返回一个路径的目录名与父路径

asp教程 返回一个路径的目录名与父路径
'############## 返回一个路径的目录名#########################################################################
function getpath(givepath)  '返回一个路径的目录名
 dim i,num,path
 path=givepath
 for i=0 to len(path)-1
  if mid(path,len(path)-i,1)="/" or mid(path,len(path)-i,1)="" then
   exit for
  end if
 next
 getpath=trim(right(path,i))
end function
'#######################################################################################
function parentn(path)   '返回一个路径的父路径
 dim i
 for i=0 to len(path)-1
  if mid(path,len(path)-i,1)="/" or mid(path,len(path)-i,1)="" then
   exit for
  end if
 next
 parentn=left(path,len(path)-i-1)
end function
'实例使用方法

getpath(givepath) 
parentn(path)

补充:asp教程,ASP入门 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,