<%@ WebHandler language= "C #" class= "Handler2"%>
Using System;
Using System.Web;
public class Handler2:ihttphandler {
public void ProcessRequest (HttpContext context) {
Context. Response.ContentType = "Text/plain";
Context. Response.Write ("Hello World");
}
public bool IsReusable {
get {
return false;
}
}
}
But in this case, it is possible to expose the code to the client.
By viewing
Code
<%@ WebHandler language= "C #" class= "Handler2"%>
The discovery can actually separate the ashx file from the specific code.
Code
<%@ WebHandler language= "C #" class= "Handler2" codebehind= "Handle2.cs"%>
Store the implemented code under the App_Code folder, which will keep your code safe.
Because
① Microsoft has set access rights to a variety of specific folders
② compiled code is rendered as DLL format, it is not easy to see the source.
Create a secure ashx file, ashx compile