|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Reading a file with StreamReader and displaying its contentsI'm trying to read a text file on my aspx page, but when I do the
following, I get a line that just says "System.IO.StreamReader " at the point of where I want the file's contents to be displayed: <%Dim strInput As StreamReader = File.OpenText("c:\inetpub\wwwroot\home\myfile.txt") Dim filename As String If File.Exists("c:\inetpub\wwwroot\home\myfile.txt") = True Then Do While strInput.Peek() >= 0 filename = strInput.ReadLine() Loop response.write(strInput) strInput.Close() End If %> ?? chum Dim strInput As StreamReader =
File.OpenText("c:\inetpub\wwwroot\home\myfile.txt") If File.Exists("c:\inetpub\wwwroot\home\myfile.txt") = True Then Do While strInput.Peek() >= 0 response.write( strInput.ReadLine() ) Loop strInput.Close() End If |
|||||||||||||||||||||||