博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ASP.NET 学习笔记_04 Session、http、web开发原则、xss漏洞
阅读量:6907 次
发布时间:2019-06-27

本文共 1701 字,大约阅读时间需要 5 分钟。

1、Session

2、验证码

YZM.ashx

<%@ WebHandler Language="C#" Class="YZM" %>using System;using System.Web;public class YZM : IHttpHandler, System.Web.SessionState.IRequiresSessionState{        public void ProcessRequest (HttpContext context) {        context.Response.ContentType = "image/JPEG";        using (System.Drawing.Bitmap bitImage = new System.Drawing.Bitmap(130, 100))        {            //设置画布            using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitImage))            {                //随机数字                Random my_random = new Random();                int num_01 = my_random.Next(100);                int num_02 = my_random.Next(100);                                int result = num_01 + num_02;                string num_string01 = num_01.ToString();                string num_string02 = num_02.ToString();                string result_string = result.ToString();                //保存到服务器的sessionid中                HttpContext.Current.Session["YZM"] = result_string;                //设置文字                g.DrawString(num_string01 +"+"+ num_string02+"?", new System.Drawing.Font("宋体", 20), System.Drawing.Brushes.Red, new System.Drawing.PointF(0, 0));                //保存到输出流中                bitImage.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);            }        }    }     public bool IsReusable {        get {            return false;        }    }}

YZM.aspx

<%--单击刷新验证码--%>
请输入验证码

3、http协议

4、按钮实现标哥行删除效果   超链接提交表单

5、web开发原则

6、XSS漏洞  

  label类似控件:Literal控件,如果 属性中text的值为<a href="www.baidu.com">hah</a>可以会被嵌入链接,

  可以设置mode属性为Encode

 7、虚拟目录~  :ASP.net中使用,始终在应用程序根目录下开始

 

 

转载地址:http://gmrdl.baihongyu.com/

你可能感兴趣的文章
jstree -- 使用JSON 数据组装成树
查看>>
C++读取INI文件
查看>>
Win2003服务器安装Sql Server 2008 (转)
查看>>
2的倍数相加后如何还原
查看>>
W3C 、HTML 、CSS 发展介绍
查看>>
JS实现点击跳转登陆邮箱
查看>>
Alexandra and Prime Numbers(思维)
查看>>
jQuery hover 延时器实现代码
查看>>
ArcGIS JS 学习笔记3 实现百度风格的BubblePopup
查看>>
JavaScript之字符串引号的使用技巧
查看>>
linux如何关闭selinux?
查看>>
初识CSS
查看>>
Android开发常用代码片段
查看>>
微信小程序使用场景及取名“潜”规则
查看>>
Atitit nodejs5 nodejs6 nodejs 7.2.1 新特性attialx总结
查看>>
回顾 git 常用命令
查看>>
第四章 Spring.Net 如何管理您的类___统一资源访问接口
查看>>
最大流+最小费用最大流
查看>>
java-mybaits-00103-入门程序原生的【查、增、删、改】
查看>>
LayoutInflater
查看>>