Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Reading  a  text file from ASP

Posted on 1999-01-29
4
Medium Priority
?
193 Views
Last Modified: 2010-04-09
Dear Friends
     Can I read a text file from my ASP
I have to take each string from the file till the EOF.
I need ASP code with explanation
0
Comment
Question by:jimevans
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
MasseyM earned 80 total points
ID: 1845822
<%
  Dim fso, f, f1, fc, s
  Set fso = CreateObject("Scripting.FileSystemObject")
      TheFile = Server.MapPath(Request.ServerVariables("SCRIPT_NAME"))
      loc = InStrRev(TheFile,"\")
      TheFile = Left(TheFile,loc)
  Set f = fso.GetFolder(TheFile)
  Set fc = f.Files
%>
<%
Set TitleFile = fso.OpenTextFile(TheFile & "yourfile.txt")
TextBuffer = TitleFile.ReadAll
TitleFile.Close
%>


this will read the entire file into the "TextBuffer" variable.
0
 
LVL 4

Expert Comment

by:martinag
ID: 1845823
Why did you delete "Getting a value from a listbox"? Because my solution worked?

Martin
0
 

Author Comment

by:jimevans
ID: 1845824
Thanks MasseyM
your code works good

Martin I have already tried the ways you have
sugessted before I posted that question. Then used a different method to solve that problem. Please dont feel bad in this issue
0
 
LVL 4

Expert Comment

by:martinag
ID: 1845825
Just being curious...How did you do?

Martin
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question