<body>
<form action=delrec.asp method=post>
<input name=getkey><input type=submit>
</form><hr>
<%
dim ar, opt, allrec, findpos
opt = clng(request.form("getkey"))
set ftxt=createobject("scripting.filesystemobject")
set ln = ftxt.opentextfile(server.mappath("/cgi-bin/search.dat"))
allrec = ln.readall
set ln = ftxt.createtextfile(server.mappath("/cgi-bin/search.dat"),true)
ar = split(allrec,chr(13)&chr(10),-1,1)
response.write("<pre>Total record : " & ubound(ar) &chr(13)&chr(10))
for i = 0 to ubound(ar)-1
if i = opt - 1 then
response.write("<b>"&ar(i)&"</b><br>")
else
response.write(ar(i)&"<br>")
ln.writeline(ar(i))
end if
next
ln.close
%>
</body>
จำนวน : 24 บรรทัด