淺談C#中的eval()函數(shù)
可以這樣說,絕大多數(shù)的大型網(wǎng)站都會(huì)用到C# eval()函數(shù),雖然一直在用,但其具體含義及使用還真沒特別去注意過,搜索了下也沒有什么明確的解釋。
翻譯過來的中文釋義大體如下:
C# eval()函數(shù),是一個(gè)用來求值的解析表達(dá)式,支持布爾型(Boolean),二進(jìn)制方式,算法,一元,所屬,
成員(例如:object.property 對(duì)象屬性),索引值(數(shù)組索引);條件函數(shù),也支持變量賦值。
其有點(diǎn)在于:
無需運(yùn)行時(shí)編譯;
無需使用JScript.NET;
無需使用數(shù)據(jù)表。
C# eval()函數(shù)英文如下:
parse expression and evaluate it. Supports Boolean, Bitwise, Arithmetic, Unary, Paren, Member (such as object.property ), Indexer (such as array[index]) and ConditionalIf(?:), also supports Variable assign.
you can use it like evaluate one statement C# source code.
not use runtime Compiler.
not use JScript.NET.
not use DataTable
【編輯推薦】