Is there a way to dynamically execute a string in .net, similar to eval() in javascript or dynamic sql in sql?

前端 未结 8 1451
心在旅途
心在旅途 2020-12-05 12:39

Is there a way to dynamically execute code contained in a string using .net 2.0, in a similar way to eval() in javascript or using sp_executeSQL in tsql?

I have a st

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-05 13:03

    I think it's possible using reflection.emit and codedom to do this, but it's not at all trivial and I advise against it.

    As an alternative, you could try configuring a format string, possibly in addition to the regex.

提交回复
热议问题