private void ErrorPage404(HttpListenerContext context)
{
context.Response.StatusCode = (int)HttpStatusCode.NotFound;
using (StreamWriter writer = new StreamWriter(context.Response.OutputStream))
{
writer.WriteLine("<!DOCTYPE html><html><head><title>404 Not Found</title></head>" +
"<body><h1>Not Found</h1><p>The requested URL " + HttpUtility.HtmlEncode(HttpUtility.UrlDecode(context.Request.RawUrl)) +
" was not found on this server.</p></body></html>");
}
}