⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 service.aspx

📁 asp.net_Lesson5
💻 ASPX
字号:
<html>
	<head>
		<title>Cookie应用举例</title>
		<script Language="C#" runat="server">
      void Page_Load()
      {
        try
        {
         Hashtable loginUser = HashFile.ReadHashtableFromFile(Server.MapPath("login.txt"));
         HttpCookie CookieUser = Request.Cookies["user"];
         if( CookieUser == null )
         {
           Response.Redirect("Login.aspx");
           return;
         }
         else if( (string)loginUser[CookieUser.Value] != Request.Cookies["id"].Value )
         {
           Response.Redirect("Login.aspx");
           return;
         }
       }
       catch(System.Threading.ThreadAbortException e)
       {
       }
       catch(Exception e)
       {
         Response.Write(e.ToString());
         Response.End();
         return;
       }
     }
		</script>
	</head>
	<body>
		<h3>登录成功!</h3>
		<hr />
		选择您需要的服务:
		<ol>
			<li><a href="mailto:nobody@nobody.com">发送邮件</a>
			<li><a href="http://news.sina.com.cn">查看新闻</a>
			<li><a href="http://game.sina.com.cn">在线游戏</a>
			<li><a href="logout.aspx">注销</a>
    </ol>
	</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -