Question | GetMethods(BindingFlags flag) | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 6

Question | GetMethods(BindingFlags flag)

Hello. Why when I use GetMethods() with any flags(BindingFlags.Public, BindingFlags.DeclaredOnly, ...)- here no detected methods? Without flags - okay. https://code.sololearn.com/cDqgPVMserdZ/?ref=app

9th Oct 2017, 2:13 PM
Podretyz
Podretyz - avatar
2 Antworten
+ 1
You must specify Instance or Static along with Public or NonPublic or no members will be returned. like this: GetMembers(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public);
9th Oct 2017, 3:00 PM
HAL8999++;
HAL8999++; - avatar
+ 7
Thank you HAL8999+;. I understand :)
9th Oct 2017, 3:05 PM
Podretyz
Podretyz - avatar