• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

string to function using reflection

Given that I know the name of a function.  Is it possible to take the string name and use reflection to call the function?

Please give an example in c# code
0
gustierng
Asked:
gustierng
1 Solution
 
Jaime OlivaresSoftware ArchitectCommented:
you also will need the class, assuming you know the class type at runtime, it should be something like:

typeof(yourclass).GetMethod(....).Invoke(....);
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now