<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System" %>
<%@ Page Language="VB" %>
<HTML>
<script language="VB" runat="server">
Sub Page_Load(source As Object, E As EventArgs)
Dim FileName As String = Server.MapPath("test.txt")
Dim FileContents As String
Dim myStreamReader As StreamReader
Try
myStreamReader = File.OpenText(FileName)
FileContents = myStreamReader.ReadToEnd()
Label1.Text = FileContents.Replace(vbCrLf,"<br>")
Catch myException As Exception
If Not myStreamReader Is Nothing Then
myStreamReader.Close()
End If
Label1.Text = "bug! <br>" & myException.Message
End Try
End Sub
</script>
<asp:Label id="Label1" runat="server">Label</asp:Label>
</HTML>