2014-05-10 49 views
0

我不知道是否有某種方法來執行字符串,或將其轉換爲代碼,例如: 「Console.WriteLine(\」Hello \「)」;執行一個字符串作爲代碼

等效於JavaScript中的'eval'。

我翻譯了谷歌翻譯。

Translate Google

+0

旁註容易可行的:有一個葡萄牙語版本的堆棧溢出:http://pt.stackoverflow.com/ –

+0

可能重複[如何動態讀取C#類的屬性?](http://stackoverflow.com/questions/4629/how-can- i-read-the-ac-sharp-class-properties的屬性) –

+0

http://stackoverflow.com/questions/12964790/using-c-sharp-as-my-dsl-is-this-在這種情況下,ChristopheD的答案(如下)是最好的。 – philologon

回答