RadioDld.RssServer.ErrorPage404 C# (CSharp) Method

ErrorPage404() private method

private ErrorPage404 ( HttpListenerContext context ) : void
context System.Net.HttpListenerContext
return void
        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>");
            }
        }