Sign in
Google apps
Main menu
Post a Comment On:
j4neiros
"Exception.ToString() vs. Exception.Message"
No comments yet. -
1 – 0 of 0
ToString is superior than Message. Very useful for debugging purposes!
using System;
using System.Collections.Generic;
using System.Text;
namespace ExceptionToString
{
public class MyClass {}
public class ArgExceptionExample
{
static void Main(string[] args)
{
MyClass my = new MyClass();
string s = "sometext";
try
{
int i = s.CompareTo(my);
}
catch (Exception ex)
{
Console.WriteLine("Error: {0}\n", ex.ToString());
Console.WriteLine("Error: {0}", ex.Message);
Console.Read();
}
}
}
}
posted by J. Ernesto Aneiros at
10:55 AM
on Jun 8, 2010
Leave your comment
You can use some HTML tags, such as
<b>, <i>, <a>
Choose an identity
Google Account
You will be asked to sign in after submitting your comment.
Name/URL
Comment with your Google account if you’d like to be able to manage your comments in the future. If you comment anonymously, you won’t be able to edit or delete your comment.
Learn more
Name
URL
Anonymous
Comment with your Google account if you’d like to be able to manage your comments in the future. If you comment anonymously, you won’t be able to edit or delete your comment.
Learn more
Please prove you're not a robot
"Exception.ToString() vs. Exception.Message"
No comments yet. -