Wrox Programmer Forums
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 1st, 2007, 06:25 PM
Friend of Wrox
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41

wrap a VBScript date function around the value you redering in the browser. EG:


NOTE: If the date argument includes time information, DateValue doesn't return it. However, if date includes invalid time information (such as "89:98"), an error occurs.

Wind is your friend
Old September 18th, 2015, 02:43 PM
Registered User
Join Date: Sep 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Is there anything faster than FSO?

I have a script in fso that searches multiple pdf's at the same time, its pretty fast comparing that only has 50 pdf's but i have another library that have over 3k pdf's.

This is the code that I'm using, is taking an average of 3-5 minutes to finish the search:

<% Server.ScriptTimeout = 100000000 %>
'Search Text
Dim strtextToSearch
strtextToSearch = Request("TextToSearch")

'Now, we want to search all of the files
Dim fso

'Constant to read
Const ForReading = 1
Set fso = Server.CreateObject("Scripting.FileSystemObject")

'Specify the folder path to search.
Dim FolderToSearch
FolderToSearch = "C:\inetpub\mysite\myfiles\"

'Proceed if folder exists
if fso.FolderExists(FolderToSearch) then

Dim objFolder
Set objFolder = fso.GetFolder(FolderToSearch)

Dim objFile, objTextStream, strFileContents, bolFileFound
bolFileFound = False

Dim FilesCounter
FilesCounter = 0 'Total files found

For Each objFile in objFolder.Files
Set objTextStream = fso.OpenTextFile(objFile.Path,ForReading)
'Read the content
strFileContents = objTextStream.ReadAll
If InStr(1,strFileContents,strtextToSearch,1) then
<a href="http://mysite.com/myfiles/<%Response.Write objFile.Name%>" target="_blank">
Response.Write objFile.Name & "</a><br>"
FilesCounter = FilesCounter + 1
End If

if FilesCounter = 0 then
Response.Write "Sorry, No matches found."
Response.Write "Total files found : " & FilesCounter
end if

'Destroy the objects
Set objTextStream = Nothing
Set objFolder = Nothing

Response.Write "Sorry, invalid folder name"
end if
Set fso = Nothing
Old February 22nd, 2017, 12:11 AM
Registered User
Join Date: Feb 2017
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reads folder contents and links drop down selector to download

<form name="form1" method="post" action="backup.asp">
<table width="100%" border="0" cellpadding="2">
<td class="smallspecialbold" nowrap>Select Download File</td>
<td width="100%">
<select name="downloadfile">
<%'Joel Martinez 2001
dim jm_fso, jm_file, jm_types, jm_path, jm_folder,jm_show,jm_i,jm_ext
jm_path = databasefolder
jm_types = split(replace("bmp,bak,mdb"," ",""),",")
Set jm_fso = Server.CreateObject("Scripting.FileSystemObject")
Set jm_folder = jm_fso.GetFolder(Server.MapPath(jm_path))

For Each jm_file in jm_folder.Files
for jm_i=0 to ubound(jm_types,1)
If lcase(right(jm_file.name,3)) = jm_types(jm_i) then jm_show=true
If jm_show=true then
if jm_ext=true then
response.write "<option value="""& jm_path & jm_File.Name & """>" & jm_File.Name & "</option>" &vbcrlf
response.write "<option value="""& jm_path & jm_File.Name & """>" & mid(jm_File.Name,1,len(jm_File.Name)-4) & "</option>" &vbcrlf
end if
end if
set jm_file=nothing
set jm_folder = nothing
set jm_fso=nothing%>
<input type="submit" class="button" name="Submit" value="Download Backup">

Similar Threads
Thread Thread Starter Forum Replies Last Post
Switching list content dynamically ... asearle XSLT 1 September 24th, 2006 11:41 AM
View Files in a Directory echovue Access 1 October 15th, 2005 02:36 PM
list asp varialbes dynamically marco_1 Classic ASP Professional 2 June 14th, 2004 01:25 PM
update list/menu value dynamically anjila Classic ASP Basics 1 February 5th, 2004 05:41 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.