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

  • Amazon Web Services

    Amazon Web S

    8 NİSAN 2009
  • paikimchung

    paikimchung

    12 Mayıs 2006
  • VOICE TV

    VOICE TV

    2 Aralık 2010