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

  • multimediaGEEKS LLC

    multimediaGE

    3 Mayıs 2010
  • MusicDeluxeTV

    MusicDeluxeT

    14 Mayıs 2010
  • ShotgunSandwichENT

    ShotgunSandw

    3 EKİM 2012