zoukankan      html  css  js  c++  java
  • Application和Session的例子

    %@ Page Language="C#" AutoEventWireup="true" CodeBehind="ApplicationTest.aspx.cs" Inherits="WebApplication1.ApplicationTest" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Application和Session的例子</title>
    </head>
    <body>
        <%
    //如果没有设置名为"ApplicationCount"的Application
    int applicationCount=1;
    int sessionCount=1;
    if(Application["ApplicationCount"]==null)
    {
    Application["ApplicationCount"]=1;
    }
    else//否则取出该Session,并且在当前值上加1
    {
    applicationCount=(int)Application["ApplicationCount"]+1;
    Application["ApplicationCount"]=applicationCount;
    }
    //如果Session["SessionCount"]为空,即没有设置该名字的Session
    if(Session["SessionCount"]==null)
    {
    Session["SessionCount"]=1;
    }
    else
    {
    sessionCount=(int)Session["SessionCount"]+1;
    Session["SessionCount"]=sessionCount;
    }
    Response.Write("当前页面由Application记录到的被访问了"+applicationCount+"次<br/>");
    Response.Write("当前页面由Session记录到的被访问了"+sessionCount+"次<br/>");
    %>>
    </body>
    </html>
  • 相关阅读:
    人脸旋转 《转》
    深度学习如何入门?<知乎>
    openGL-------------别人的博客
    如何实现视频的快进快退功能(转)
    MFC+OpenGL基础绘制<转>
    野蒜
    人脸识别68个点<转>
    cv::circle《转》
    HTML5 Canvas之猜数字游戏
    LIRe 源代码分析 3:基本接口(ImageSearcher)
  • 原文地址:https://www.cnblogs.com/ai394495243/p/3335267.html
Copyright © 2011-2022 走看看