PDA

Click to See Complete Forum and Search --> : dynamic active server pages


navarchy
Apr 1st, 2001, 08:58 PM
I am more of a vb programmer than an asp programmer so please try to bear with me. I am trying to create a singal webpage that can open a text file and put the contents of the file onto the webpage. Maybe I could make it so like textreader.asp#info.txt would open info.txt and put that text file in the page. My use for this is to simply make my numerous text files look a little bit nicer. Please email me at navarchy@AOL.com or post a reply if you can help.

josmond
Apr 2nd, 2001, 07:18 AM
To insert the contents of a textfile into a td, paste this into your <td>
<%
ForReading = 1
FileName = Server.MapPath("/robots.txt")
Set objFile = Server.CreateObject("Scripting.FileSystemObject")
Set objCoun = objFile.OpenTextFile(FileName, ForReading)
Response.Write objCoun.ReadAll
objCoun.Close
%>