td>
TR>
TABLE>
Font>
-------------------
.cs file:
Namespace JianWeb
{
Using system;
Using system.data;
Using system.drawing;
Using system.Web;
Using system.Web.ui.webcontrols;
Using system.Web.ui.htmlcontrols;
///
A summary description of /// counter.
/// summary>
Public Class Counter: System.Web.ui.userControl
{
Protected system.web.ui.htmlcontrols.htmltable Table_counter;
Private Void Page_Load (Object Sender, System.EventArgs E)
{
/ / Place the user code here to initialize the page
String filepath = system.Web.httpContext.current.server.mappath ("hits.txt");
System.io.StreamReader srreadline = new system.io.streamReader
System.IO.File.Openread (FilePath),
System.Text.Encoding.ascii); // encoding.default is reading Chinese
Srreadline.basestream.seek (0, System.io.seekorigin.begin); //
String countstr = "";
IF (SRREADLINE.PEEK ()> -1)
{
CountStr = Srreadline.Readline ();
}
INT count = int.parse (countstr) 1;
Countstr = count.toString ();
SRREADLINE.CLOSE ();
Table_counter.rows [1] .cells [0] .INNNNERHTML = "";
For (int i = 0; i
{
Table_counter.rows [1] .Cells [0] .innerhtml = Table_Counter.Rows [1] .cells [0] .INNNERHTML ";
}
Table_counter.rows [1] .cells [0] .INNNERHTML = " font>";
// Write the string to a file.
System.io.StreamWriter file = new system.io.streamwriter (filepath);
File.WriteLine (Countstr, False);
File.Close ();
SRREADLINE.CLOSE ();
}
#Region web form designer generated code
Override protected void oninit (Eventargs E)
{
//
// Codegen: This call is necessary for the ASP.NET Web Form Designer.
//
InitializationComponent ();
Base.onit (E);
}
///
/// Designer supports the required method - do not use the code editor
// / Modify the content of this method.
/// summary>
Private vidinitiRizeComponent ()
{
This.Load = New System.EventHandler (this.page_load);
}
#ndregion
}
}
----------------------------------------- Why is it like? One sand gull in the world.
转载请注明原文地址:https://www.9cbs.com/read-75016.html
|