asp.net 第五天 html简单的模板
来源:互联网 发布:活动执行方案范文知乎 编辑:程序博客网 时间:2024/06/05 18:09
Login.ashx
==============================================
<%@ WebHandler Language="C#" Class="Login" %>
using System;
using System.Web;
public class Login : IHttpHandler {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/html";
string username=context.Request["username"];
string password=context.Request["password"];
string html = "<html><head></head><body><form action='Login.ashx' method='get'><input type='text' name='username' value='{username}'/><input type='password' name='password' value='{password}'/><input type='submit' value='登陆'></form><p>{msg}</p></body></html>";
if (string.IsNullOrEmpty(username) && string.IsNullOrEmpty(password))
{
//context.Response.Write("<html>");
//context.Response.Write("<head></head>");
//context.Response.Write("<body><form action='Login.ashx' method='get'><input type='text' name='username'/><input type='password' name='password'/><input type='submit' value='登陆'></form></body>");
//context.Response.Write("</html>");
string code = html.Replace("{username}","");
code = code.Replace("{password}","");
code = code.Replace("{msg}","");
context.Response.Write(code);
}
else
{
if (username == "admin" && password == "123")
{
context.Response.Write("<html><head></head><body>登陆成功</body></html>");
}
else
{
//context.Response.Write("<html>");
//context.Response.Write("<head></head>");
//context.Response.Write("<body><form action='Login.ashx' method='get'><input type='text' name='username' value='"+username+"'/><input type='password' name='password' value='"+password+"'/><input type='submit' value='登陆'><p>用户名或者密码错误</p></form></body>");
//context.Response.Write("</html>");
string code = html.Replace("{username}",username);
code = code.Replace("{password}",password);
code = code.Replace("{msg}","用户名或者密码错误");
context.Response.Write(code);
// context.Response.Write("<html><head></head><body>用户名或者密码错误</body></html>");
}
}
}
public bool IsReusable {
get {
return false;
}
}
}
- asp.net 第五天 html简单的模板
- 简单的asp.net gridview模板
- ASP.net中模板的简单使用
- MySQL第五天---存储过程、查询区分大小写、事务(MySQL及Java实现的简单模板)
- html第五天
- 10天学会ASP.net之第五天
- 10天学会ASP.net之第五天
- 10天学会ASP.net之第五天
- 十天学会ASP.net之第五天
- 十天学会ASP.net之第五天
- 十天学会ASP.net之第五天
- 十天学会ASP.net之第五天
- ASP.Net 实战项目 之 《图书商城》 第五天
- ASP.NET读取HTML模板生成HTML
- .net学习第五天
- html简单的模板
- asp.net模板引擎:C#中Nvelocity的简单使用
- 我的html学习——第五天
- ubuntu 文件夹都跑到桌面上了!!
- javascript_汉诺塔
- 页面创建新元素
- VIM命令小抄
- 【小宝解惑】vc下debug版本和release版本的区别
- asp.net 第五天 html简单的模板
- 算法面试题
- Hadoop海量视频、图像分析分布式处理总结
- 移动APP开发过程
- 内核模块Makefile
- QListWidget 滚动条设置风格
- 融博
- 支付宝木马爆菊过程总结帖【附源码】
- QScrollBar样式