Danh mục

Hit Counter and Visitor Online of ASP.NET

Số trang: 3      Loại file: pdf      Dung lượng: 6.92 KB      Lượt xem: 2      Lượt tải: 0    
Thu Hiền

Xem trước 2 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

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;
Nội dung trích xuất từ tài liệu:
Hit Counter and Visitor Online of ASP.NET Hit Counter and Visitor Online of ASP.NETHit Counterclass 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;objStreamReader.Close();Return iCounter;}public void WriteFile(){StreamWrite objStreamWrite;objStreamWrite=File.CreateText(sCounterPage);objStreamWrite.Write(iCounter.ToString());objStreamWrite.Close();}}Visitor OnlineSub Application_OnStart(Object sender, EventArgs e){Application[VistorOnline]=0;}Sub Sessioin_OnStart(Object sender, EventArgs e){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;}

Tài liệu được xem nhiều: