Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SIMPLE question

Status
Not open for further replies.

CompCop911

Programmer
Jun 9, 2004
33
0
0
CA
How do you take ALL the contents of a text file (like a text file containing sample ASP code) and store it into a variable?

Also, will

dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("output.asp",true)

work to create ASP files or no?

ComputerCop911
ASP and HTML Programmer
Learning VB.NET and ASP.NET
Can also help with hardware probs
 
Create File object with fs.OpenTextFile(). And then use f.readAll().

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
Ok but can you create a .asp file with the snippet I posted above?

dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("output.asp",true)

ComputerCop911
ASP and HTML Programmer
Learning VB.NET and ASP.NET
Can also help with hardware probs
 
You can name the file anything you want, including using an ASP extension. If it's valid ASP and HTML, it will produce the desired web page when viewed on a browser through a web server that handles ASP.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top