
November 18th, 2009, 01:13 PM
|
|
Registered User
|
|
Join Date: Nov 2009
Posts: 1
Time spent in forums: 10 m 53 sec
Reputation Power: 0
|
|
|
VBScript - General - Question - TextStream Object
I was following the ASP TextStream Object tutorial at w3schools that allows me to read part of a textfile, which is uploaded daily to my FTP server. The problem I am having is that the name of the file is always different (it has randomly generated numbers).
For example:
Yesterday: quote23989.txt
Today: quote2349875.txt
Tomorrow: quote948924.txt
The code below works perfect for reading the data, but I have to tell it what the text file's name is. Is there anyway to use wildcards after the word "quote" so that any text file starts with "quote" will be read? I tried a few different solutions found on these forums, but nothing seems to work.
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile(Server.MapPath("quote.txt"), 1)
Response.Write(f.Read(5))
f.Close
Set f=Nothing
Set fs=Nothing
%>
Thank you for the help.
-Mike
|