1.新建一個一般處理程序
新建一個一般處理程序
2.看看里頭的代碼
public class MyHandler : IHttpHandler
{
public void PRocessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("Hello World");
}
public bool IsReusable
{
get
{
return false;
}
}
}
通常講,我們的邏輯,大多寫在 ProcessRequest里頭。
2.GET和POST
Html表單<form>可以自動給服務器提交參數。
get是通過url請求參數的方式提交,請求參數會直接暴露在url中。
post是通過報文體,提交的數據不會直接暴露給用戶。
新聞熱點
疑難解答