allora con questo codice stò allestendo una chat senza pretese, devo dire che funziona solo che il problema riguarda la textbox che una volta che legge il file la scrollbar si posiziona all'inizio,
come posso ovviare al problema magari sostituendo anche la textbox'
codice:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="chat.aspx.vb" Inherits="chat" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Pagina senza titolo</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:Timer ID="Timer1" OnTick="Timer1_Tick" runat="server"
Interval="2000" />
<asp:UpdatePanel ID="StockPricePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox ID="TextBox1" runat="server" Height="461px" TextMode="MultiLine"
Width="819px"></asp:TextBox>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" />
</Triggers>
</asp:UpdatePanel>
<asp:TextBox ID="TextBox2" runat="server" Width="690px"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />
</p>
</form>
</body>
</html>
codice:
Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.TextBox1.Text = My.Computer.FileSystem.ReadAllText(Server.MapPath("log.txt"))
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
My.Computer.FileSystem.WriteAllText(Server.MapPath("log.txt"), User.Identity.Name + ": " + Me.TextBox2.Text + vbCrLf, True)
End Sub