资源简介
AjaxLogin.rar
代码片段和文件信息
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace WebApplication1
{
public partial class CheckStuLogin : System.Web.UI.Page
{
protected void Page_Load(object sender EventArgs e)
{
//接收jQuery ajax传送过来的用户名和密码。此方法可同时适用于get和post方式
string name = Request[“UserName“];
string pwd = Request[“UserPwd“];
string Content = ““; //输出的数据(要符合json格式)
if (name == “1“ && pwd == “1“) //判断用户名和密码是否正确?
{
Session[“Name“] = name; //记录其Session
//生成登录成功后的HTML代码
string LoginContent = “yle=‘width:100%; height:100%; background-color:Pink; border-collapse :collapse; text-align:left; ‘>“;
LoginContent += “yle=‘text-align: center‘>欢迎: yle=‘text-align: center‘>“ + Session[“Name“].ToString() + “ “;
LoginContent += “ yle=‘height: 20px; text-align: center‘>班级: yle=‘height: 20px; text-align: center;‘>班级 “;
LoginContent += “ yle=‘height: 20px; text-align: center‘>登录次数: yle=‘height: 20px; text-align: center;‘ >登录次数 “;
LoginContent += “yle=‘text-align:center;‘>修改密码 yle=‘height: 20px; text-align: center;‘>注销 “;
LoginContent += “
“;
Content = CreateJson(“登录成功“ LoginContent 1);
}
else
{
Content = CreateJson(“登陆失败“ “登录失败,用户名或密码错误!“ 0);
}
Response.Clear();
Response.ContentType = “application/json“;
Response.Write(Content);//输出带有JSON格式的数据
//发送JSON格式的数据到客户端并终止该页的执行
//注意这个方法必须有否则会出错
Response.End();
}
#region 生成json格式的消息
///
/// 消息内容。符合json格式。
///
/// tle“>消息的标题
/// 消息内容
/// 消息标志位。1:合法, 0 不合法。
///
public string CreateJson(string title string data int flag)
{
string text = “{\“title\“:\““ + title + “\“\“Data\“:\““ + data + “\“\“Flag\“:“ + flag + “}“;
return text;
}
#endregion
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 20480 2010-12-05 14:56 AjaxLogin\WebApplication1\bin\WebApplication1.dll
文件 22016 2010-12-05 14:56 AjaxLogin\WebApplication1\bin\WebApplication1.pdb
文件 467 2010-12-05 14:42 AjaxLogin\WebApplication1\CheckStuLogin.aspx
文件 2847 2010-12-05 14:56 AjaxLogin\WebApplication1\CheckStuLogin.aspx.cs
文件 992 2010-12-05 14:42 AjaxLogin\WebApplication1\CheckStuLogin.aspx.designer.cs
文件 1102 2010-12-05 14:54 AjaxLogin\WebApplication1\Default.aspx
文件 2412 2010-12-05 14:45 AjaxLogin\WebApplication1\Default.aspx.cs
文件 982 2010-12-05 14:10 AjaxLogin\WebApplication1\Default.aspx.designer.cs
文件 72174 2010-12-05 13:38 AjaxLogin\WebApplication1\js\jquery-1.4.2.min.js
文件 1976 2010-12-05 14:49 AjaxLogin\WebApplication1\js\login.js
文件 20480 2010-12-05 14:56 AjaxLogin\WebApplication1\obj\Debug\WebApplication1.dll
文件 22016 2010-12-05 14:56 AjaxLogin\WebApplication1\obj\Debug\WebApplication1.pdb
文件 154 2010-12-05 14:56 AjaxLogin\WebApplication1\obj\WebApplication1.csproj.FileList.txt
文件 558 2010-12-05 14:54 AjaxLogin\WebApplication1\OtherPage.aspx
文件 464 2010-12-05 13:40 AjaxLogin\WebApplication1\OtherPage.aspx.cs
文件 984 2010-12-05 13:40 AjaxLogin\WebApplication1\OtherPage.aspx.designer.cs
文件 1348 2010-12-05 13:36 AjaxLogin\WebApplication1\Properties\AssemblyInfo.cs
文件 4084 2010-12-05 14:52 AjaxLogin\WebApplication1\WebApplication1.csproj
文件 1142 2010-12-05 14:52 AjaxLogin\WebApplication1\WebApplication1.csproj.user
文件 1068 2010-12-05 13:36 AjaxLogin\WebApplication1\WebApplication1.sln
..A..H. 17408 2010-12-05 14:56 AjaxLogin\WebApplication1\WebApplication1.suo
目录 0 2010-12-05 14:28 AjaxLogin\WebApplication1\obj\Debug\Refactor
目录 0 2010-12-05 13:36 AjaxLogin\WebApplication1\obj\Debug\TempPE
目录 0 2010-12-05 14:56 AjaxLogin\WebApplication1\obj\Debug
目录 0 2010-12-05 13:41 AjaxLogin\WebApplication1\bin
目录 0 2010-12-05 14:49 AjaxLogin\WebApplication1\js
目录 0 2010-12-05 13:41 AjaxLogin\WebApplication1\obj
目录 0 2010-12-05 13:36 AjaxLogin\WebApplication1\Properties
目录 0 2010-12-05 14:56 AjaxLogin\WebApplication1
目录 0 2010-12-05 13:36 AjaxLogin
............此处省略3个文件信息
- 上一篇:Socket 类封装 改进版
- 下一篇:Arduino HMC5883L库文件
相关资源
- PID_AutoTune_v0.rar
- vspd7.2.308.zip
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
川公网安备 51152502000135号
评论
共有 条评论