asp 截取文件扩展名
我有一个文件名 aaa.bbb.rar或者a.b.c.d.html或者aa.b.dd.shtml
我怎样截取文件的后缀名呀。。。
<%
aa="aaa.bbb.rar"
bb=split(aa,".")
response.write bb(ubound(bb))
%>
修改一下楼上的代码。
VBScript code:
<%
aa="aaa.bbb.rar"
bb=split(aa,".")
if ubound(bb)=0 then
response.write ""
else
response.write trim(bb(ubound(bb)))
end if
%>
s = "F:\aaa\xxx.aaa.txt"
Response.Write("文件名: " & Mid(s, InStrRev(s, "\") + 1, Len(s) - InStrRev(s, "\")))
Response.Write("文件后缀: " & Mid(s, InStrRev(s, ".") + 1, Len(s) - InStrRev(s, ".")))
http://www.bhcode.net/article/20080721/1820.html
path="aaa.bbb.rar"
kzname=split(path,".")(ubound(split(path,".")))
VBScript code:
path="aaa.bbb.rar"
kzname=split(path,".")(ubound(split(path,".")))
相关问答:
<%@language="vbscript"%>
<%option explicit%>
<html>
<head> <title>xxx </title> </head>
<script language=vbs>
'注意变量 ......
<form id="form1" runat="server">
<div>
<script type="text/javascript">
function oo(a){
document.getEleme ......
HTML code:
dim jf
set conn=server.createobject("adodb.connection")
connstr="Driver={Sql Server};Server="&Sqlip&";Database="&Sqldb&";Uid="& ......
文件:folder.inc
HTML code:
<%
Dim folderini,pos,pageName
fPath = Request.ServerVariables("PATH_TRANSLATED")
pos = instrRev(fPath,"\")
folderini = Left(fPath,pos)+&qu ......