qqchen的方法,具体一下:System.Diagnostics.StackFrame sf = new System.Diagnostics.StackFrame(true); string s = String.Format("FileName:{0}\r\nMethod:{1}\r\nLine number:{2}\r\n",sf.GetFileName(),sf.GetMethod().Name,sf.GetFileLineNumber()); MessageBox.Show(s);其中,GetMethod之后,你可以采用reflection进行其他的操作
string s = String.Format("FileName:{0}\r\nMethod:{1}\r\nLine number:{2}\r\n",sf.GetFileName(),sf.GetMethod().Name,sf.GetFileLineNumber());
MessageBox.Show(s);其中,GetMethod之后,你可以采用reflection进行其他的操作