private void button1_Click(object sender, EventArgs e) { try { dynamic model = new { UserID = 5016 }; string path = @"E:\T_开文\公共类\KuRazorCommon\KuRazorCommon_Test\demo.txt"; string sourceCode = System.IO.File.ReadAllText(path, System.Text.Encoding.GetEncoding("GBK")); KuRazor.IsDebug = false; KuRazor.CreateDLL <dynamic>(sourceCode, model, "ddd", "dll/"); MessageBox.Show("生成成功!"); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }