4
I’m studying C# and I’m trying to learn a little reverse engineering.
I’m making the following mistake:
private void button1_Click(object sender, EventArgs e)
{
this.Result = true;
this.ConfigName = this.textBox1.Text;
string sourceFileName = new string[] { Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Tibia", this.BaseName }.Aggregate<string>(new Func<string, string, string>(Path.Combine));
string destFileName = new string[] { Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Tibia", this.ConfigName }.Aggregate<string>(new Func<string, string, string>(Path.Combine));
File.Copy(sourceFileName, destFileName);
base.Close();
}
Displays the following error:
Error CS0246 The type or namespace name 'Func' could not be found (are you Missing a using Directive or an Assembly Reference?)
In another part of the code
ConfigFinder.FindConfigs((ConfigFinder.ConfigListHandler) (arr => base.Invoke(() => configcombo.Items.AddRange(arr))));
He introduces me:
Error CS1660 Cannot Convert lambda Expression to type 'Delegate' because it
And still in the code
private void button1_Click(object sender, EventArgs e)
{
this.Result = true;
this.ConfigName = this.textBox1.Text;
string sourceFileName = new string[] { Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Tibia", this.BaseName }.Aggregate<string>(new Func<string, string, string>(Path.Combine));
string destFileName = new string[] { Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Tibia", this.ConfigName }.Aggregate<string>(new Func<string, string, string>(Path.Combine));
File.Copy(sourceFileName, destFileName);
base.Close();
}
shows the error:
Error CS1061 'string[]' does not contain a Definition for 'Aggregate' and no Extension method 'Aggregate' Accepting a first argument of type 'string[]' could be found (are you Missing a using Directive or an Assembly Reference?)
What can it be?