%option explicit%>
<%
Dim intI
Dim intJ
Dim intK
Dim intRandom
Dim strNameOne
Dim strNameTwo
Dim strRead_Text_One
Dim strRead_Text_Two
Dim objFSO
Dim objFolder
Dim objPage
Dim objFile
set objFSO = CreateObject("Scripting.FileSystemObject")
'Change this to match your environment:
set objFolder = objFSO.GetFolder(Server.MapPath("/front-boxes/"))
'response.write(objFolder.files.count & "
")
'response.write "
"
Randomize
intRandom = Int(Rnd * objFolder.files.count) + 1
'response.write intrandom&" "
intI = 0
for each objFile in objFolder.files
intI = intI + 1
if intI = intRandom then
intJ = intI
strNameOne = objFile.Name
exit for
end if
next
' Open the document to be read
'set fso = createobject("scripting.filesystemobject")
set objPage = objFSO.opentextfile(server.mappath("/front-boxes/"&strNameOne))
'read all the text on the document
strRead_Text_One = objPage.readall
' Close the document
objPage.close
' Write out the contents of the document
' to the browser
'second instance of random name generation
intRandom = intI
while intI = intRandom
Randomize
intRandom = Int(Rnd * objFolder.files.count) + 1
wend
'response.write intrandom&"
"
intK = 0
for each objFile in objFolder.files
intK = intK + 1
if intK = intRandom then
strNameTwo = objFile.Name
exit for
end if
next
'response.write intI&"
"
'response.write intK
' Open the document to be read
'set fso = createobject("scripting.filesystemobject")
set objPage = objFSO.opentextfile(server.mappath("/front-boxes/"&strNameTwo))
'read all the text on the document
strRead_Text_Two = objPage.readall
' Close the document
objPage.close
' Write out the contents of the document
' to the browser
%>
