try
{
throw new Exception();
}
catch (Exception ex)
{
// Get stack trace for the exception with source file information
int lineNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileLineNumber();
var columnNumber = (new System.Diagnostics.StackFrame(0, true)).GetFileColumnNumber();
var strName = System.IO.Path.GetFileName((new System.Diagnostics.StackFrame(0, true)).GetFileName());
MessageBox.Show(strName);
}
Hiç yorum yok:
Yorum Gönder