Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check form existence of a method
Message
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00745631
Message ID:
00745643
Views:
22
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform