Skip to content

Instantly share code, notes, and snippets.

@KentaKomai
Created June 4, 2014 08:50
Show Gist options
  • Save KentaKomai/0457f37cdd7728ae57cb to your computer and use it in GitHub Desktop.
Save KentaKomai/0457f37cdd7728ae57cb to your computer and use it in GitHub Desktop.
StackTrace 中身
try
{
throw new Exception();
}
catch (Exception exp)
{
StackTrace st = new StackTrace(exp, true);
StackFrame sf = st.GetFrame(0);
Console.WriteLine(sf.GetFileName());
Console.WriteLine(sf.GetFileLineNumber());
Console.WriteLine(sf.GetFileColumnNumber());
Console.WriteLine(exp.Message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment