I have an assignment and I'm stuck.
I have to upload an image to a text file. No problem.
But then I have to read that file and be able to click on the image name and view that image. That's where I'm stuck.
Here is the code to reading the text file, but how do I code it to made the file names either hyperlinks or if when the file opens the file names are viewed as the images. Any help would be greatly appreciated.
<%@ Page Language="VB" %>
<%@ import Namespace="System.IO" %>
<% @ import Namespace="System.Web.UI.Webcontrols" %>
<script runat="server">
Sub Page_Load(Source as Object, e as EventArgs)
dim fs as new FileStream(Server.MapPath("files.txt"), FileMode.Open, FileAccess.Read)
dim objReader as new StreamReader(fs)
While objReader.Peek() > -1 'Test to for end of file
Response.Write(objReader.ReadLine & "<br>")
End While
objReader.Close
fs.close
End Sub
I have to upload an image to a text file. No problem.
But then I have to read that file and be able to click on the image name and view that image. That's where I'm stuck.
Here is the code to reading the text file, but how do I code it to made the file names either hyperlinks or if when the file opens the file names are viewed as the images. Any help would be greatly appreciated.
<%@ Page Language="VB" %>
<%@ import Namespace="System.IO" %>
<% @ import Namespace="System.Web.UI.Webcontrols" %>
<script runat="server">
Sub Page_Load(Source as Object, e as EventArgs)
dim fs as new FileStream(Server.MapPath("files.txt"), FileMode.Open, FileAccess.Read)
dim objReader as new StreamReader(fs)
While objReader.Peek() > -1 'Test to for end of file
Response.Write(objReader.ReadLine & "<br>")
End While
objReader.Close
fs.close
End Sub