1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
<html>
<body>
<%
if request.form("position") <> "" then
position = request.form("position")
else
position = 0
end if
const ForReading = 1
const TristateFalse = 0
dim objFS
dim objFile
dim objTS
set objFS = Server.CreateObject("Scripting.FileSystemObject")
set objFile = objFS.GetFile(Server.MapPath("script.sql"))
set objTS = objFile.OpenAsTextStream(ForReading, TristateFalse)
filecontent = objTS.Read(objFile.Size)
filecontent = Right(filecontent, objFile.Size - position)
tableau = Array(0,0,0,0)
tableau(0) = Instr(6,filecontent,"DELETE")
tableau(1) = Instr(6,filecontent,"UPDATE")
tableau(2) = Instr(6,filecontent,"INSERT")
tableau(3) = Instr(6,filecontent,"SELECT")
for i = 0 to 3
for j = i + 1 to 3
if tableau(i)< tableau(j) then
x = tableau(j)
tableau(j) = tableau(i)
tableau(i) = x
end if
next
next
for i = 0 to 3
if tableau(i) <> 0 then
endreq = tableau(i)
end if
next
if endreq <> 0 then
req = trim(left(filecontent,endreq - 3))
response.write req
response.write "<form action='slice.asp' method=POST>"
response.write "<input type=hidden name='position' value='" & position + endreq - 1 & "'>"
response.write "<input type=submit value='NEXT'>"
response.write "</form>"
else
response.write "FINI"
end if
%>
</body>
</html> |
Partager