六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網(wǎng)中心:是一個免費提供流行視頻軟件教程、在線學(xué)習(xí)分享的學(xué)習(xí)平臺!

asp.net中用C#完成網(wǎng)站計數(shù)器用戶控件

[摘要]資源:同級目錄下的存放當(dāng)前計數(shù)的count.txt文件 子目錄pic下的0到9的數(shù)字圖片0.gif ~ 9.gif -------------------------------- asax文件: <%@ Control Language="c#" AutoEventWi...

資源:同級目錄下的存放當(dāng)前計數(shù)的count.txt文件
子目錄pic下的0到9的數(shù)字圖片0.gif ~ 9.gif
--------------------------------
asax文件:
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="counter.ascx.cs" Inherits="JiAnWeb.counter" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<LINK href="css.css" rel="stylesheet">
<FONT face="宋體">
<TABLE id="table_counter" cellSpacing="0" cellPadding="0" width="750" align="center" border="0"
runat="server">
<TR>
<TD style="HEIGHT: 23px" align="center" valign=middle><IMG height="1" alt='asp.net中用C#實現(xiàn)站點計數(shù)器用戶控件' src="http://www.okasp.com/techinfo/pic/rightblueback.gif" width="700"></TD>
</TR>
<TR>
<TD align=center valign=middle></TD>
</TR>
</TABLE>
</FONT>
-------------------
.cs文件:
namespace JiAnWeb
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

/// <summary>
/// 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)
{
// 在此處放置用戶代碼以初始化頁面
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是讀中文
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].InnerHtml="<font color=\"#009900\">";
for (int i=0;i<countStr.Length;i++)
{
table_counter.Rows[1].Cells[0].InnerHtml=table_counter.Rows[1].Cells[0].InnerHtml+"<img src=\"pic\\"+countStr.Substring(i,1)+".gif\">";
}
table_counter.Rows[1].Cells[0].InnerHtml+="</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 窗體設(shè)計器生成的代碼
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 該調(diào)用是 ASP.NET Web 窗體設(shè)計器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 設(shè)計器支持所需的方法 - 不要使用代碼編輯器
/// 修改此方法的內(nèi)容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion
}
}




主站蜘蛛池模板: 中文天堂在线最新版在线www | 一级黄色片免费播放 | 午夜小视频男女在线观看 | 伊人精品视频 | 特级做a爰片毛片免费看 | 人人福利| 欧美视频免费 | 欧美怡红院视频一区二区三区 | 亚洲一区二区三区在线免费观看 | 中文字幕不卡在线 | 日韩精品亚洲一级在线观看 | 五月婷婷爱 | 亚洲不卡| 五月婷色| 天天插天天干天天射 | 亚洲国产天堂久久综合 | 在线看欧美成人中文字幕视频 | 亚洲欧美日韩精品一区 | 亚洲视频第一页 | 日韩亚洲一区二区三区 | 色综合久久伊人 | 日韩在线1 | 日韩啪啪片 | 亚洲成年男人的天堂网 | 亚洲v日韩v欧美在线观看 | 四虎在线免费观看视频 | 午夜精品久久久久久久99热下载 | 亚洲欧美无人区乱码 | 午夜婷婷网 | 色无极影院亚洲 | 日产精品久久久一区二区 | 亚洲乱码一二三四区国产 | 天天综合天天操 | 亚洲综合狠狠 | 日日碰夜夜爽 | 欧美性大战久久久久久 | 亚州一级毛片 | 日韩一区二区三区免费 | 色综合网址 | 日本免费看片在线播放 | 青草香蕉视频 |