MCQs > IT & Programming > .NET > In your Web application, you create a class to implement the IHttpHandler interface. Which code will display the Warning.jpg image in the browser whenever the handler is requested?

.NET MCQs

In your Web application, you create a class to implement the IHttpHandler interface. Which code will display the Warning.jpg image in the browser whenever the handler is requested?

Answer

Correct Answer: public void ProcessRequest(HttpContext ctx){ctx.Response.ContentType = "image/jpg";FileStream fs = File.OpenRead(_ctx.Server.MapPath("Warning.jpg"));int b = 0;while ((b == fs.ReadByte()) != -1) {ctx.Response.OutputStream.WriteByte(Convert.

Explanation:

Note: This Question is unanswered, help us to find answer for this one

.NET Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

.NET Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it