I have a method that always has the same signature but the name changes a little. An example is below. Suggestions? (that is, what is the code to generate the call to Method9 when you form the name on the fly.
Thanks!
for (int i=0;i<10;i++)
{
string myMethodName = "Method" + i.ToString();
CALL METHOD WITH DYNAMIC NAME
THAT IS Method9("stringvalue",999,true);
}
class public void Method9(string str,int iVal,bool printit)
{
...
}
class public void Method10(string str,int iVal,bool printit)
pkellner
All-Star
24042 Points
3625 Posts
ASPInsiders
Moderator
MVP
Pinvoke problem possibly?
Apr 09, 2009 03:41 PM|LINK
I have a method that always has the same signature but the name changes a little. An example is below. Suggestions? (that is, what is the code to generate the call to Method9 when you form the name on the fly.
Thanks!
for (int i=0;i<10;i++)
{
string myMethodName = "Method" + i.ToString();
CALL METHOD WITH DYNAMIC NAME
THAT IS Method9("stringvalue",999,true);
}
class public void Method9(string str,int iVal,bool printit)
{
...
}
class public void Method10(string str,int iVal,bool printit)
{
...
}
...
http://peterkellner.net
Microsoft MVP • ASPInsider