日期:2014-05-18 浏览次数:20686 次
public static object Eval(string AExpression) { try { return new DataTable().Compute(AExpression, ""); } catch { return null; } } private void button1_Click(object sender, EventArgs e) { Text = Eval("(1.5+2.5)*2/4").ToString(); }