Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Formatting Error Stack Trace

Posted on 2007-03-20
1
Medium Priority
?
252 Views
Last Modified: 2010-04-16
Hi,

I'm trying to sned my error stack trace in an email. What I'm currently doing it literally string  str = e.StackTrace; and assigning str as the email body. It send ok. But there is no formatting to it and it's really tedious to read. I was wondering if anyone knows how I could format this so that it appears one line after another like it does in the runtime error. Thanks

0
Comment
Question by:bowemc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 25

Accepted Solution

by:
dstanley9 earned 2000 total points
ID: 18755793
Are you sending HTML messages?  If so, use this:

    private static string cleanHTML(string Html)
    {
        // Cleans the string for HTML friendly display

        if (Html == null || Html.Length == 0)
            return "";
        return HttpUtility.HtmlEncode(Html).Replace("\r\n", "<BR>").Replace(" ", "&nbsp;");
    }

and in your error code use string str = cleanHTML(e.StackTrace);
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question