How do i load a plaintext file in a aspx website / newbie

D

david.vantongerloo

How do i load a plaintext file in a aspx website / newbie

now i use :
<table>
< iframe src=" text.txt " with="100" heighr="200" >
</table>

Thanks for info.
 
J

John Timney \(MVP\)

Heres some code. You should be able to load your file, iterate through it
and either response.write the lines of the file out or attach it to a label
(as here), or another control.

StreamReader re = File.OpenText(Server.MapPath("blah.txt"));
string input = null;
string textstuff = null;
while ((input = re.ReadLine()) != null)
{
textstuff += input + "<br>";
}
re.Close();
Label1.Text = textstuff.ToString();

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top