<1>
Htmlpage.htm page [Request Page]
<HTML xmlns = "http://www.w3.org/1999/xhtml">
General handler. ashx page [processing Page]
<% @ Webhandler Language = "C #" class = "handler" %> using system; using system. web; public class handler: ihttphandler {// request. form can obtain the data submitted in post mode, requst. querystring can get the data submitted by the get method, while request can get the data transmitted by both methods at the same time; // speed: request. qeurystring is slightly faster than request. form // according to the transmitted data volume: request. form can transmit unlimited data, request. querystring can only pass 2 K of data. // For ease of installation: the request itself is direct and can be obtained no matter how the data is transmitted. The performance is slightly reduced, public void processrequest (httpcontext context) {context. response. contenttype = "text/html"; // --------------------------------------------------------- request. querystring [""] ------------ // when the method attribute of the <form> form on the htmlpage.htm page is set to get. request. querystring ["username"] takes effect only when the value string username1 = context is obtained. request. querystring ["username"]; // --------------------------------------------------------- request. form [""] ----------------- // request. form is the object that receives the POST method // request when the method attribute of the <form> form on the htmlpage.htm page is set to post. form ["username"] takes effect only when the value string username2 = context is obtained. request. form ["username"]; // configure request [""] ------------------------ // set the method attribute of the <form> form on the htmlpage.htm page to post, get, and context. request ["username"] can obtain the value string username3 = context. request ["username"]; // ------------------------------------ request. requesttype ----- obtain the HTTP transmission method ----------- // obtain or set the HTTP data transmission method (get or post) string requesttype = context. request. requesttype; context. response. write (username1); context. response. write (username2); context. response. write (username3);} public bool isreusable {get {return false ;}}}
Zookeeper