Attach screenshot in a saved report

Feb 27, 2015 at 12:57 PM
Edited Feb 27, 2015 at 12:58 PM
Modify line 1 in source file "CrashReport.cs"
At function CreateReport, line 313:
string report = string.Format(@"<br/>
                        <div class=""content"">
                        <div class=""title"" style=""background-color: #66CCFF;"">
                        <h3>Exception Type</h3>
                        </div>
                        <div class=""message"">
                        <p>{0}</p>
                        </div>
                        </div><br/>
                        <div class=""content"">
                        <div class=""title"" style=""background-color: #66CCFF;"">
                        <h3>Error Message</h3>
                        </div>
                        <div class=""message"">
                        <p>{1}</p>
                        </div>
                        </div><br/>
                        <div class=""content"">
                        <div class=""title"" style=""background-color: #66CCFF;"">
                        <h3>Source</h3>
                        </div>
                        <div class=""message"">
                        <p>{2}</p>
                        </div>
                        </div><br/>
                        <div class=""content"">
                        <div class=""title"" style=""background-color: #66CCFF;"">
                        <h3>Stack Trace</h3>
                        </div>
                        <div class=""message"">
                        <p>{3}</p>
                        </div>
                        <div class=""Screenshot"">
                        <p>{4}</p>
                        </div>
                        </div>", HttpUtility.HtmlEncode(exception.GetType().ToString()),
                HttpUtility.HtmlEncode(exception.Message),
                HttpUtility.HtmlEncode(exception.Source ?? "No source"),
                HttpUtility.HtmlEncode(exception.StackTrace ?? "No stack trace").Replace("\r\n", "<br/>"),
                HttpUtility.HtmlEncode(Convert.ToBase64String(File.ReadAllBytes(_reportCrash.ScreenShot))));