if trim(word)="" then
alert "关键字为空!"
searchKey.focus
exit sub
else
dim l
for each l in list.getElementsByTagName("DIV")
if l.id<>"seachList" then list.removeChild l
next
seachList.innerText = "搜索结果"
seachWord thisFileFolder
seachList.insertAdjacentHTML "AfterEnd",seachResult
seachList.innerText = "搜索结果:" & num & "个"
alert "搜索完毕!"
end if
end sub
sub seachWord(theFolder)
dim f,f1,st,re,fd,fd1
set f = fso.GetFolder(theFolder)
for each f1 in f.Files
if isTxt(f1.name) then
if instr(f1.name,word)>0 then
seachResult = seachResult & "<div class='file' title='" & f1.path
seachResult = seachResult & "'><span class='fileIcon'>2" & "</span>"
seachResult = seachResult & "<input value='"
fName = getTxtName(f1.name)
seachResult = seachResult & fName & "' title='" & fName & "'>"
seachResult = seachResult & "</div>"
num = num + 1
else
set st = f1.OpenAsTextStream
'逐行读
Do While st.AtEndOfStream <> True
if instr(st.ReadLine,word)>0 then
num = num +1
seachResult = seachResult & "<div class='file' title='" & f1.path
seachResult = seachResult & "'><span class='fileIcon'>2" & "</span>"
seachResult = seachResult & "<input value='"
fName = getTxtName(f1.name)
seachResult = seachResult & fName & "' title='" & fName & "'>"
seachResult = seachResult & "</div>"
exit do
end if
Loop
st.Close
end if
end if
next
set fd = fso.GetFolder(theFolder)
for each fd1 in fd.SubFolders
seachWord fd1
next
end sub
sub showHelp
dim msg
msg = " 文本代码管理工具【IE5.5以上版本】" & vbcrlf
msg = msg & "------------------------------------------------" & vbcrlf
msg = msg & " 使用方法:放到文本类型的文件夹里面,双击运行。" & vbcrlf
msg = msg & "功能:" & vbcrlf
msg = msg & "1,快速浏览,预览CTRL+B,搜索文本类型的文件和代码;" & vbcrlf
msg = msg & "2,按DEL可以删除点中的文件和文件夹;" & vbcrlf
msg = msg & "3,可以修改文件名和文字内容,CTRL+S保存;" & vbcrlf
msg = msg & "4,可以创建文件CTRL+N并且编辑保存;" & vbcrlf
msg = msg & "5,文本编辑支持TAB和shift+TAB键;" & vbcrlf
msg = msg & vbcrlf
msg = msg & "作者:CSDN超级大笨狼[2005/1/18版本]" & vbcrlf
msg = msg & "欢迎传播使用,交流代码panyuguang962@sohu.com" & vbcrlf
msg = msg & "http://superdullwolf.cnzone.net/index.asp" & vbcrlf









