CODE
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="WebApplication2.WebForm1"%>
<%@ Import Namespace="System.IO" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<script language="VB" runat="server">
Sub Page_Load(Sender as object, E as EventArgs)
dim fs as new FileStream(Server.MapPath("counter.txt"),FileMode.Open,FileAccess.Read)
dim objReader as new StreamReader(fs)
objReader.close()
fs.close
dim objWriter as new StreamWriter(Server.MapPath("counter.txt"),true)
objWriter.WriteLine("Hi There")
objWriter.close()
lblCounter2.Text="Good Afternoon"
lblCounter3.Text="Good Evening"
End Sub
</script>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body BGCOLOR="#55666" TEXT="#ffffcc" LINK="#cc9600" ALINK="#cc6600" VLINK="#969696" MS_POSITIONING="GridLayout">
<asp:Label id="lblCounter" style="Z-INDEX: 107; LEFT: 744px; POSITION: absolute; TOP: 680px"
runat="server" />
< <asp:Label ID="lblCounter2" Runat=server />
<asp:Label ID="lblCounter3" Runat="server" />
</body>
</HTML>
Mod Edit: Please use code tags when posting your code. Code tags are used like so =>

Thanks,
PsychoCoder

Note: I eliminated all of the code that works. I am trying to populate er, lblCounter2 and lblCounter3 with "Good AfterNoon and Good Evening. It is not working
Also
I am trying to write to the file counter.txt which is the same directory as the aspx page and that is not working.
There are no error messages
This post has been edited by everest_01: 16 Aug, 2008 - 11:58 AM