Click to See Complete Forum and Search --> : Basic dynamic news updates


gLitch
03-22-2003, 02:56 PM
I am fairly new to ASP design implentation and I was curious if there was a way to write data from say..a word perfect .doc file or a .txt file straight to the page without having to go in and change the website's coding every time there was a news update. If you can help either by posting a URL to a site that can explain the process or help by posting the process your self, I would be endebted to you.

-gLitch

khaki
03-23-2003, 02:04 PM
Hi gLitch...

I posted a similar question a while back.
This is how I eventually got it working for my needs:

<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")

Set f=fs.OpenTextFile(Server.MapPath("yourFile.txt"), 1)

str = f.ReadAll
str = Replace(str, vbCrLf, (vbCrLf & "<br>"), 1, -1)
Response.Write(str)
Response.Write "<br>"

f.Close

Set f=Nothing
Set fs=Nothing
%>

The user will get the latest update of the file on each call to the server (initial or refresh).
Is this what you are looking for?
k