<html><head><title>同文件夾內(nèi)文本搜索器(vbs)</title> 
<meta http-equiv=content-type content="text/html; charset=gb2312"> 
<script language=vbscript id=clienteventhandlersvbs> 
<!-- 
dim fso, f, f1, fc,fn,s,uf1,ufn 
sub b1_onclick 
fn=t1.value '' 
pn=mid(location.pathname,2,len(location.pathname)-14) 
showfolderlist(pn) 
end sub 
function showfolderlist(path) 
 ''msgbox path 
 set fso = createobject("scripting.filesystemobject") 
 set f = fso.getfolder(path) 
 set fc = f.files 
 '' ufn=ucase(fn) 
 for each f1 in fc 
 filespec= path & f1.name 
 readentirefile(filespec) 
 '' uf1=ucase(f1.name) 
 '' if instr(uf1,ufn) <> 0 then 
 '' s=s & "<a href=" & path & f1.name & ">" & f1.name & "</a><br>" 
 '' end if 
 next 
 document.write "已搜索到以下條目,請單擊之。[墨伯編制 于2003年元月]<br>" 
 document.write s 
 set fc=nothing 
 set f=nothing 
 set fso=nothing 
 end function 
function readentirefile(filespec) 
 const forreading = 1 
 dim fso, thefile, retstring 
 set fso = createobject("scripting.filesystemobject") 
 set thefile = fso.opentextfile(filespec, forreading, false) 
 ufn=ucase(fn) 
 do while thefile.atendofstream<> true 
 retstring = thefile.readline 
 uf1=ucase(retstring) 
 if instr(uf1,ufn) <> 0 then 
 s=s & "<a href=" & path & f1.name & ">" & f1.name & "</a><br>" 
 exit do 
 end if 
 loop 
 thefile.close 
 readentirefile = s 
 end function 
--> 
 </script> 
 </head> 
 <body> 
 <p align=center><font color=#000000 size=6>請輸入要搜索[在正文中包含]的關(guān)鍵詞(</font><font 
 color=#000000 size=3>忽略大小寫</font><font color=#000000 size=6>)</font> </p> 
 <p align=center><font size=2><font color=#000000>[墨伯編制 
 于2003年1月5日]</font> </font> </p> 
 <p align=center><input name=t1><input type=button value=搜索! name=b1></p> 
 <p align=center> </p></body></html> 
新聞熱點
疑難解答
圖片精選