intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

Hit Counter and Visitor Online of ASP.NET

Chia sẻ: Abcdef_44 Abcdef_44 | Ngày: | Loại File: PDF | Số trang:3

67
lượt xem
6
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Hit Counter class Counter { private string sCounterPage; private string sCounter; private int iCounter; public Counter(string sPath) { sCounterPage=sPath; }public int ReadFile() { StreamReader bjStreamReader; bjStreamReader=File.OpenText(sCounterPage); sCounter=objStreamReader.ReadToEnd(); iCounter=(int)(sCounter); iCounter +=1;

Chủ đề:
Lưu

Nội dung Text: Hit Counter and Visitor Online of ASP.NET

  1. Hit Counter and Visitor Online of ASP.NET Hit Counter class Counter { private string sCounterPage; private string sCounter; private int iCounter; public Counter(string sPath) { sCounterPage=sPath; } public int ReadFile() { StreamReader objStreamReader; objStreamReader=File.OpenText(sCounterPage); sCounter=objStreamReader.ReadToEnd(); iCounter=(int)(sCounter); iCounter +=1;
  2. objStreamReader.Close(); Return iCounter; } public void WriteFile() { StreamWrite objStreamWrite; objStreamWrite=File.CreateText(sCounterPage); objStreamWrite.Write(iCounter.ToString()); objStreamWrite.Close(); } } Visitor Online Sub Application_OnStart(Object sender, EventArgs e) { Application["VistorOnline"]=0; } Sub Sessioin_OnStart(Object sender, EventArgs e)
  3. { Session.TimeOut=... Application.Lock; Application["VisitorOnline"]=Application + 1; Application.UnLock; } Sub Session_OnEnd(Object sender, EventArgs e) { Application.Lock; Application["VisitorOnline"]=Application - 1; Application.UnLock; }
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2