解释一下 即时编译 ,,不要抄了,,谢谢 ^_^

来源:百度知道 编辑:UC知道 时间:2024/06/02 03:36:11
c#.net的即时编译,,解释一下,,
解释到位了俺加分
还是没有具体的就即时编译解释啊

.net程序编译时生成的是中间语言IL, IL是不能直接被硬件执行的,需要虚拟机层(对.net来说就是CLR)解析执行,解析是需要代价的,所以无论是.net的CLR还是java的jvm,都采用了即时编译技术,在运行时对中间代码再次编译,转化成对应平台的程序指令,使程序效率更加接近原生的应用程序

我按照参考做了一个例子看看,但是总在那句报错,我找了很多方法还是不行..郁闷ing...
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
using Microsoft.CSharp;
using System.Reflection;
using System.Windows.Forms;
using System.Text;

namespace CompilerApp
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
GetValue("aaaa");
}

static object GetValue( string value )
{
StringBuilder codeSnippet = new String