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:
00745643
Vues:
23
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.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform