本地计数器
来源:互联网 发布:马鹿野郎 知乎 编辑:程序博客网 时间:2024/05/02 01:03
#region 计数器 if (!Page.IsPostBack) { string countFile = Server.MapPath("counter.txt"); int count = 1; if (!File.Exists(countFile)) { StreamWriter sw = File.CreateText(countFile); sw.WriteLine("1"); sw.Flush(); sw.Close(); } else { StreamReader srReadLine = new StreamReader(countFile, System.Text.Encoding.Default); if (Session["VisitorNum"] == null) { count = Convert.ToInt32(srReadLine.ReadLine()) + 1; srReadLine.Close(); try { StreamWriter sw = File.CreateText(countFile); sw.WriteLine(count.ToString()); sw.Flush(); sw.Close(); } catch (Exception ex) { Response.Write(ex.Message); } Session["VisitorNum"] = "wei"; } else { count = Convert.ToInt32(srReadLine.ReadLine()); srReadLine.Close(); } this.lblVistorNum.Text = count.ToString(); } } #endregion
- 本地计数器
- Properties+重温Map+本地计数器
- 计数器
- 计数器
- 计数器
- 计数器
- 计数器
- 计数器
- 计数器
- 计数器
- 计数器
- 计数器
- 计数器
- 计数器
- 计数器
- 计数器
- 计数器
- 计数器
- GCC-3.4.6源代码学习笔记(25续1)
- Direct3D模板技术
- GLSL实现HDR Rendering
- 函数指针与指针函数
- WebService(入门--大讲堂)之Axis2(1):用POJO实现0配置的WebService
- 本地计数器
- GCC-3.4.6源代码学习笔记(25续2)
- 执行代理报:Unknown LotusScript Error!
- 通过渲染到浮点纹理实现三维对象拾取
- 惠普前总裁孙振耀指点职业规划
- Direct3D渲染到纹理
- 2010经典语录
- 让PHP开发者事半功倍的十大技巧
- 显示控制