Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check form existence of a method
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00745631
Message ID:
00746085
Vues:
19
Thanks, Cathy, the MethodInfo object worked like a charm. I also needed to verify an object property, so I tried "Dim memInfo as PropertyInfo ..." and it worked as well. I guess that's why a standardized naming convention is valuable.

Thanks again.

>Hi Don,
>
>You can use the GetMethod method of the Type class to see if a method exists. Here is some sample code:
>
>
>Dim typ As System.Type = GetType(MyClass)
>Dim memInfo As MethodInfo= typ.GetMethod("MyMethod",BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.Static Or BindingFlags.Public)
>If memInfo Is Nothing
>   ' Method NOT found
>End If
>
>
>>Can anyone give me advice on how to check for the existence of a method in an object before calling it in VB.Net? In VFP I use a call to PEMSTATUS(), but haven't found an equivalent in VB.Net.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform