نمایش خط خطا در C#

خرید بک لینک

System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace(ex, true);
System.Diagnostics.StackFrame[] frames = st.GetFrames();

// Iterate over the frames extracting the information you need

foreach (System.Diagnostics.StackFrame frame in frames)
{
msg += string.Format("n Method Path : {0} n Method Name : {1}n Method Line : {2} n Mehtod StatIndex In Line : {3}", frame.GetFileName(), frame.GetMethod().Name, frame.GetFileLineNumber(), frame.GetFileColumnNumber()) + "n-----------------------------------n";
}

|+| نوشته شده توسط علی نعیم آبادی در سه شنبه دهم اسفند ۱۳۹۵ |
C# و SQL Server نکته های جالب و مهم در ...

ما را در سایت C# و SQL Server نکته های جالب و مهم در دنبال می‌کنید

برچسب: نویسنده: بازدید: 156 تاريخ: دوشنبه 26 تير 1396 ساعت: 1:38

صفحه بندی