This is what I used, but it did not cause much interest in the phone - but it might work for you with tweeking:
private static string lineAndMethod() { int stack_frame_depth = 5; StackFrame sf = new StackFrame(stack_frame_depth, true); while (sf.GetFileName() == null && stack_frame_depth > 0) sf = new StackFrame(--stack_frame_depth, true); if (sf.GetFileName() == null)
Ricibob
source share