⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.htm

📁 本文件包基于asp.net + javascript方式
💻 HTM
字号:
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<script language="VBScript">
'从完整路径中获得纯文件名
public function fnGetFilename(sfull)
	if sfull="" or instr(1,sfull,".")=0 then 
		fnGetFilename=false
	else
		dim pos
		do until instr(1,sfull,"/")=0
			pos=instr(1,sfull,"/")
			sfull=right(sfull,len(sfull)-pos)
		loop
		fnGetFilename=sfull
	end if 
end function

public function fnGetSrc(fulltag)
	dim spos
	spos=instr(fulltag,"src")
	if spos<>0 then 
		endpos=instr(spos+5,fulltag," ")
		fnGetSrc=mid(fulltag,spos+5,endpos-spos-6)
	else
		fnGetSrc=false
	end if 
end function

public function fnGetSrc_verA(fulltag)
	dim spos
	spos=instr(fulltag,"src")
	if spos<>0 then 
		pos1=instr(spos+3,fulltag,"'")
		pos2=instr(pos1+1,fulltag,"'")
		if pos1<>0 and pos2<>0 then 
			fnGetSrc=mid(fulltag,pos1+1,pos2-pos1-1)
		else
			fnGetSrc=false
		end if 
	else
		fnGetSrc=false
	end if 
end function

public function fnGetTag(str,tagname)
	dim pos,endpos
	str=lcase(str)
	pos=instr(str,"<"+tagname)
	if pos<>0 then 
		endpos=instr(pos,str,">")
		fnGetTag=mid(str,pos,endpos-pos+1)
	else
		fnGetTag=false
	end if 
end function

s="<td><rt>fsdfsdfsdfsd<rw>34</34></tr><IMG id=97549 alt='' src='file:///C:/Documents%20and%20Settings/Administrator/Desktop/pageDesign/PageDesign_v2/images/mytoolbar.gif' align=baseline border=0><sdf>sdf<sdf><sdf><sdf>"
a=fnGetTag(s,"img")
b=fnGetSrc(a)
'c=fnGetFilename(b)
msgbox(a)
msgbox(b)
msgbox(c)
</script>

<span id=sys></span><br>
<input type="button" value=test onclick="vbscript:sys.innerHTML=fnGetFilename('c:\windows\inner html\scripts\test\qq\dr\css.css')">
<br>

</BODY>

</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -