1. Session
2. Verification Code
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) {// set the canvas using (system. drawing. graphics G = system. drawing. graphics. fromima Ge (bitimage) {// random number 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 (); // save it to httpcontext in the server's sessionid. current. session ["YZM"] = result_string; // set the Text G. drawstring (num_string01 + "+" + num_string0 2 + "? ", New system. drawing. font ("", 20), system. drawing. brushes. red, new system. drawing. pointf (0, 0); // save it to the bitimage in the output stream. save (context. response. outputstream, system. drawing. imaging. imageformat. JPEG) ;}} public bool isreusable {get {return false ;}}}
YZM. aspx
<Form ID = "form1" runat = "server"> <div> <% -- Click Refresh verification code -- %> </div> <asp: textbox id =" textbox1 "runat =" server "text =" "> </ASP: textbox> <asp: button id = "button1" runat = "server" onclick = "button#click" text = "button"/> </form>
3. http protocol
4. click the button to implement the hyperlink submission form for the effect of deleting the regular expression row
5. Web development principles
6. XSS vulnerabilities
Label is similar to the control: literal control. If the value of text in the property is <a href = "www.baidu.com"> hah </a>, the link can be embedded,
You can set the mode attribute to encode.
7. virtual directory ~ : Used in Asp.net, always starting under the application root directory