Type trypInfo = typeof(Program);// Program为类名 //获得方法名 string str = "包括的方法名列表:\r\n"; MethodInfo[] methodInfo = trypInfo.GetMethods(); foreach (MethodInfo mInfo in methodInfo) { str += mInfo.ToString() + "\r\n"; } MessageBox.Show(str);
Type trypInfo = typeof(Program);// Program为类名 //获得方法名 string str = "包括的方法名列表:\r\n"; MethodInfo[] methodInfo = trypInfo.GetMethods(); foreach (MethodInfo mInfo in methodInfo) { str += mInfo.ToString() + "\r\n"; } MessageBox.Show(str);