c# - How to execute code that is in a string? -


possible duplicates:
c# eval equivalent?
c# execute string code

say have this:

string singlestatement = "system.datetime.now"; 

is there way take singlestatement , parse , run @ run time?

so that:

datetime currenttime = singlestatement.somecoolmethodtorunthetext(); 

would assign value of datetime.now currenttime.

this possible using compiler services , reflection.emit() compile , assembly , load memory.

have here.

http://www.c-sharpcorner.com/uploadfile/puranindia/419/


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

sql server - python to mssql encoding problem -

windows - Python Service Installation - "Could not find PythonClass entry" -