[thelist] ASP: Load contents of a file into a variable

Joshua Olson joshua at waetech.com
Mon Sep 20 17:10:53 CDT 2004


> -----Original Message-----
> From: Casey Crookston
> Sent: Monday, September 20, 2004 6:09 PM
>
> > Is there a simpler way of loading the contents of a .txt or .html file
> intoa variable other then using ADO?

> I mean File System Objects, not ADO.

FSO is about the only way to do it.  It's not really all that bad.  If you
don't like the number of lines required to load a file, perhaps make
yourself a function to handle it...  Example:

Sub FileIntoVariable(ByVal filename, ByRef myvar)
  ' Instantiate FSO
  ' Open File/TextStream
  ' Read file into variable (myvar, btw)
Exit Sub

Then, just call the function.

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com/service_areas/
706.210.0168




More information about the thelist mailing list