资源简介
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库文件
相关资源
- UniPatcher_v2017.4.exe
- retro_snake.c
- f83s72.pdf
- haimianjie2012_10485189.zip
- WeatherForecast.zip
- 世界河流_简化.shp
- DataVisualization-master.zip
- sigar.txt
- spc统计过程控制软件破解版.XLS
- license_R2015b.lic
- NVIDIA楂樼鏄惧崱PCB鏂囦欢GF106鎸_2涓
- LEGEND.rar
- guosenyuan_1539042.zip
- xilinxvivado2017.1版安装包20GBlicense支持
- RFID.zip
- 文件过大,请参考这里.docx
- generateUserBankInfo.rar
- 驾校任务书.doc
- nr24c6.rar
- rls.doc.doc
- DES加解密演算法.rar
- SceneTest.zip
- readAPI破解key加源码.zip
- 小牛大数据资源分享.txt
- 碳足迹计算公式及注释.pdf
- ssmshiro.rar
- [北派心皇]邮箱伪造器.zip
- networkViewDEMO.unitypackage
- H5棋牌游戏.txt
- Sniffer_CardTool超级卡软件.exe
评论
共有 条评论