Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
C#
catch(Exception ex)
          {
              t.InsertErrorLog(Convert.ToInt32(lbl_U_ID.Text), "Application", ex.ToString(), " ");
          }

here i posted catching exception of Id, Type,Error and i need current form name(user_info.cs)
Posted
Updated 16-Apr-15 6:04am
v5
Comments
OriginalGriff 16-Apr-15 11:22am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Perhaps some more detail on what you are trying to do?
Use the "Improve question" widget to edit your question and provide better information.
Sergey Alexandrovich Kryukov 16-Apr-15 11:36am    
What do you mean by this name, System.Windows.Forms.Form.Name? Why? Isn't it pretty useless?
The answer depends on context.
—SA

1 solution

Try:
C#
string className = this.GetType().Name;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900