公式解析-微软类库

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using Microsoft.JScript;



namespace ConsoleApplication2

{

    class Program

    {

        static void Main(string[] args)

        {

            string formula = "Math.abs(0-0)+Math.abs(-3)";

            var num= System.Convert.ToDecimal(

                   Eval.JScriptEvaluate(formula, false, Microsoft.JScript.Vsa.VsaEngine.CreateEngine()));

            Console.WriteLine(num);

            Console.ReadKey();



        }



        public static Entity ChangEntity(Entity e)

        {

            e.Age = e.Age - 10;

            e.Name = e.Name + "love";

            return e;

        }

    }

}

  

你可能感兴趣的:(解析)