Exception stack trace

R

Raj Chudasama

How can i obtain stack trace and email it to myself?

i know when your program catches an exception you can obtain stacktrace but
i dont know hot i can have it email it to me. Is this a custom control?

thanks
 
N

Nicholas Paldino [.NET/C# MVP]

Raj,

Getting the stack trace is easy. The exception should be Serializable,
so you can serialize that for transport, and you can create a new instance
of the StackTrace object, which will pass you the StackFrame instances
representing the different calls in the stack. All of this is serializable.

Once you serialize all of that into a format you can transport, you can
look into the System.Web.Mail namespace for classes that will help you send
mail, or if you are using .NET 2.0, you can look in the System.Net.Mail
namespace for better classes to help you with this.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top