<html> <head> <title> pencari teks (VBS) di folder yang sama </iteme>
<Meta http-equiv = konten-tipe konten = teks/html; Charset = GB2312>
<Bahasa skrip = vbscript id = clienteventhandlersvbs>
<!-
Redup 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)
Akhir sub
Fungsi showfolderlist (path)
Jalur msgbox
Atur fso = createObject (scripting.filesystemObject)
Atur f = fso.getFolder (path)
Atur fc = f.files
'' ufn = uCase (fn)
Untuk setiap F1 di FC
filespec = path & f1.name
Readentirefile (filespec)
'' uf1 = uCase (f1.name)
'' if instr (uf1, ufn) <> 0 lalu
's = s & <a href = & path & f1.name &> & f1.name & </a> <br>
'' Akhiri jika
Berikutnya
Document.write Entri berikut telah dicari, silakan klik. [Disusun oleh Merber pada Januari 2003] <br>
Dokumen.Write s
atur fc = tidak ada
atur f = tidak ada
atur fso = tidak ada
Fungsi akhir
Fungsi readentirefile (filespec)
Const forreading = 1
Redup fso, thefile, retstring
Atur fso = createObject (scripting.filesystemObject)
Set theFile = fso.opentextFile (filespec, forreading, false)
ufn = ucase (fn)
Lakukan saat thefile.atendofstream <> true
retstring = theFile.readline
uf1 = ucase (retstring)
if instr (uf1, ufn) <> 0 lalu
S = S & <a href = & path & f1.name &> & f1.name & </a> <br>
keluar
akhiri jika
Lingkaran
thefile.close
Readentirefile = s
Fungsi akhir
->
</script>
</head>
<body>
<P align = center> <font color =#000000 size = 6> Harap masukkan kata kunci untuk mencari [termasuk dalam teks] (</font> <font
color =#000000 size = 3> Abaikan case </font> <font color =#000000 size = 6>) </font> </p>
<P align = center> <font size = 2> <font color =#000000> [diproduksi oleh merber
Pada 5 Januari 2003] </font> </font> </p>
<P align = center> <input name = t1> <input type = tombol nilai = Cari! name = b1> </p>
<P align = center> </p> </body> </html>