Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old August 1st, 2007, 06:25 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

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

dateValue(item.DateLastModified)

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
Matt
Reply With Quote
  #12 (permalink)  
Old September 18th, 2015, 02:43 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
objTextStream.Close
Next

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

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

else
Response.Write "Sorry, invalid folder name"
end if
Set fso = Nothing
%>
Reply With Quote
  #13 (permalink)  
Old February 21st, 2017, 11:11 PM
Registered User
Points: 19, Level: 1
Points: 19, Level: 1 Points: 19, Level: 1 Points: 19, Level: 1
Activity: 50%
Activity: 50% Activity: 50% Activity: 50%
 
Join Date: Feb 2017
Location: Houston, TX
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">
<tr>
<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_ext=true
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
jm_show=false
for jm_i=0 to ubound(jm_types,1)
If lcase(right(jm_file.name,3)) = jm_types(jm_i) then jm_show=true
next
If jm_show=true then
if jm_ext=true then
response.write "<option value="""& jm_path & jm_File.Name & """>" & jm_File.Name & "</option>" &vbcrlf
else
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
next
set jm_file=nothing
set jm_folder = nothing
set jm_fso=nothing%>
</select>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" class="button" name="Submit" value="Download Backup">
</td>
</tr>
</table>
</form>
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 04:41 AM



All times are GMT -4. The time now is 03:19 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.