SORU
12 ŞUBAT 2009, PERŞEMBE


C bir dize bir işlevi çağırmadan#

Php gibi bir çağrı yapmak mümkün olduğunu biliyorum:

$function_name = 'hello';
$function_name();

function hello() { echo 'hello'; }

Bu mümkün .Net?

CEVAP
12 ŞUBAT 2009, PERŞEMBE


Evet. Yansıma kullanabilirsiniz. Şöyle bir şey:

Type thisType = this.GetType();
MethodInfo theMethod = thisType.GetMethod(TheCommandString);
theMethod.Invoke(this, userParameters);

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Hak5

    Hak5

    7 EYLÜL 2005
  • PaulGBelliveau

    PaulGBellive

    5 Mart 2009
  • the one am radio

    the one am r

    6 Mayıs 2006