Possible Duplicate:
Calling a function from a string in C#
I would like to call one of the methods in a class from another class. The thing is that i don't know the method name in advance, i get it from external API..
Example:
class A
public class Whichone
{
public static string AA() { return "11"; }
public static string BB() { return "22"; }
public static string DK() { return "95"; }
public static string ZQ() { return "51"; }
..............
}
class B
public class Main
{
........
........
........
string APIValue = API.ToString();
string WhichOneValue = [CALL(APIValue)];
}
lets say the APIValue is BB then the value of WhichOneValue should be somehow 22. what is the right syntax to do that?