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

  • metallmanutza13

    metallmanutz

    13 NİSAN 2007
  • theavettbrothers

    theavettbrot

    9 ŞUBAT 2007
  • TheDigiCraft

    TheDigiCraft

    25 NİSAN 2011