日期:2014-05-17  浏览次数:20460 次

ASP网站登录
要做一个投票的网站,需要先登录才能投票,且每个人最多能投一次票,现在找到了一个网站模板,但没有登陆的要求,怎么修改呢,希望大家多多指点,
IIS+access+ASP

  真诚感谢。

------解决方案--------------------
为了防止用户换IP刷投票
可以用cookie实现
用户登录就在用户电脑上写入一个登陆的cookie
保存用户登录信息
用户投票的时候判断cookie中的值,
如果没有跳转到登录页面
------解决方案--------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>

<!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>WAMR登录系统</title>

<script type="text/javascript" language="JavaScript">
//禁止浏览器后退方法
javascript:window.history.forward(1);



</script>

<%-- <script type="text/javascript" src="ymPrompt.js"></script>
--%>
<meta http-equiv="Expries" content="0" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<style type="text/css">
.styleDiv
{
height: 100%;
border: 0px 0px 0px 0px;
}
.styleLeft
{
width: 70%;
text-align: left;
height: 100%;
}
.tdStyle
{
text-align: center;
width: 30px;
height: 28px;
}
.lableStyle
{
text-align: center;
}
.lblFont
{
font-size: 15pt;
color: #191970;
}
.lblFont1
{
font-size: 13pt;
color: #7B68EE;
}
.style2
{
text-align: center;
width: 85px;
height: 28px;
}
.imgStyle
{
border-bottom: 0px;
border-right: 0px;
border-left: 0px;
border-top: 0px;
}
.style3
{
width: 85px;
text-align: center;
}
.btnStyle
{
text-align: center;
background-color: #E6E6FA;
font-size: 13pt;
}
.btn-tdStyle
{
width: 60%;
}
.a_font
{
font-size: 11pt;
color: #7B68EE;
text-align: center;
}
.a_font1
{
font-size: 9pt;
}
</style>

</head>
<body>
<form id="form1" runat="server">
<div class="styleDiv">
<img alt="" src="image/top.jpg" style="width: 100%; height: 41px; margin-left: 4px;" />
<span>
<img alt="" src="image/WAMR.jpg" style="height: 36px" /></span><a class="lblFont"> 你要的登录界面介绍 </a>
<table class="styleDiv">
<tr>
<td class="styleLeft">
<img alt="登录图片" src="image/登录.jpg" style="width: 100%" />
</td>
<td>