Hello:
I have the following code, uit does tell me the program that I am in. Is there a way to find out what is the routine that I am in? In the sample below, I would like to have it return: 'Enter'.
public void Enter(string FromProgram_ID)
{
Program_ID = this.ToString();
MessageBox.Show("IN: " + Program_ID + " Called From: " + FromProgram_ID);
}
Loading
Sailaja YPosted Mar 24, 2010, 5:01 AM
Please try the below code in the Enter method to display the method name.
For Example:
public void Enter(string FromProgram_ID)
{
string methodName = string.Format("Inside {0}",new System.Diagnostics.StackFrame(1).GetMethod().Name);
MessageBox.Show(methodName );
}
This displays "Inside Enter".
If it helps you, please mark it as answer.
Regards,
GustavoPosted Mar 24, 2010, 5:06 AM
Thank you... it worked.