public static RuntimeCsharpCompiler.CsharpCompilerParameters GetScripts(FileInfo[] files) { var ps = new RuntimeCsharpCompiler.CsharpCompilerParameters(); for (int i = 0; i < files.Length; i++) { if (files[i].Exists) { if (files[i].Name == "refs.txt") { ps.ReferencedAssemblies.AddRange(File.ReadAllLines(files[i].FullName)); } else if (files[i].Extension == ".cs") { ps.Codes.Add(File.ReadAllText(files[i].FullName)); } } } return(ps); }
private void Fasdfsa() { Parameters = RuntimeCsharpCore.GetScripts(); //textBox1.Text = string.Join(Environment.NewLine, Parameters.ReferencedAssemblies.Cast<string>().ToArray()); //textBox1.Text += "\r\n\r\n\r\n" + string.Join(Environment.NewLine, Parameters.Codes.Cast<string>().ToArray()); }