当前位置:网站首页>aspx 简单的用户登录
aspx 简单的用户登录
2022-07-05 13:32:00 【白露-】
1.登录界面
<%@ Page Language="C#" CodeFile="c.aspx.cs" Inherits="cs.c" %>
<!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 id="Head1" runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server" action="b.aspx" method="post">
账户:<asp:TextBox ID="userid" runat="server"></asp:TextBox><br />
密码:<asp:TextBox ID="userpwd" runat="server"></asp:TextBox><br />
<asp:Button ID="Button1" runat="server" Text="登录" />
</form>
</body>
</html>
cs文件:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.OleDb;
namespace cs
{
public partial class c : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//这里给用户一个简单的提示,提示用户用户名或密码可能输入错误
String verify = Request.QueryString["verify"];
Boolean vf=Convert.ToBoolean(verify);
if (!vf)
{
Response.Write("<script>alert('您输入的账户或密码错误,请重新输入!!!!')</script>");
}
}
}
}
2.验证界面cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
namespace cs
{
public partial class b : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
String userid = Request.Form["userid"];
String userpwd = Request.Form["userpwd"];
//提取post数据,然后判断密码与账户是否正确,如果不正确,则返回至登录界面
if (userpwd != "abc" || userid !="123")
{
Response.Redirect("c.aspx?verify=false");
}
}
}
}
边栏推荐
- Catch all asynchronous artifact completable future
- With 4 years of working experience, you can't tell five ways of communication between multithreads. Dare you believe it?
- Multi person cooperation project to see how many lines of code each person has written
- FPGA learning notes: vivado 2019.1 add IP MicroBlaze
- Idea set method annotation and class annotation
- jenkins安装
- “百度杯”CTF比赛 九月场,Web:Upload
- Shu tianmeng map × Weiyan technology - Dream map database circle of friends + 1
- 峰会回顾|保旺达-合规和安全双驱动的数据安全整体防护体系
- Resttemplate details
猜你喜欢

Could not set property 'ID' of 'class xx' with value 'XX' argument type mismatch solution

Flutter 3.0更新后如何应用到小程序开发中

面试官灵魂拷问:为什么代码规范要求 SQL 语句不要过多的 join?
![[深度学习论文笔记]UCTransNet:从transformer的通道角度重新思考U-Net中的跳跃连接](/img/b6/f9da8a36167db10c9a92dabb166c81.png)
[深度学习论文笔记]UCTransNet:从transformer的通道角度重新思考U-Net中的跳跃连接

Android本地Sqlite数据库的备份和还原

Although the volume and price fall, why are the structural deposits of commercial banks favored by listed companies?
![[深度学习论文笔记]TransBTSV2: Wider Instead of Deeper Transformer for Medical Image Segmentation](/img/70/6de0346df8527af6c88db1ff89947b.png)
[深度学习论文笔记]TransBTSV2: Wider Instead of Deeper Transformer for Medical Image Segmentation

Asemi rectifier bridge hd06 parameters, hd06 pictures, hd06 applications

Interviewer soul torture: why does the code specification require SQL statements not to have too many joins?

LB10S-ASEMI整流桥LB10S
随机推荐
什么是网络端口
mysql econnreset_ Nodejs socket error handling error: read econnreset
FPGA learning notes: vivado 2019.1 add IP MicroBlaze
APICloud Studio3 API管理与调试使用教程
Difference between avc1 and H264
同事半个月都没搞懂selenium,我半个小时就给他整明白!顺手秀了一波爬淘宝的操作[通俗易懂]
Lb10s-asemi rectifier bridge lb10s
How to choose note taking software? Comparison and evaluation of notion, flowus and WOLAI
Solve the problem of "unable to open source file" xx.h "in the custom header file on vs from the source
Talking about fake demand from takeout order
Catch all asynchronous artifact completable future
TortoiseSVN使用情形、安装与使用
Usage, installation and use of TortoiseSVN
Go pointer
个人组件 - 消息提示
C# 对象存储
Multi person cooperation project to see how many lines of code each person has written
The real king of caching, Google guava is just a brother
面试官灵魂拷问:为什么代码规范要求 SQL 语句不要过多的 join?
js判断数组中是否存在某个元素(四种方法)