我正在尝试使用 csc 将我的 C# 程序编译为独立的 .exe,但不知何故我无法从该项目的资源中包含两个 .exe。我在最终的standalone.exe 中需要它们。csc 告诉我它们是二进制文件而不是文本文件(嗯,呵呵)。任何帮助,将不胜感激 !:3
编辑:使用/resource:我把它缩小到这个:
此外,如果它很重要:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
bool is64bit = !string.IsNullOrEmpty(
Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"));
if (is64bit == true)
{
ProcessStartInfo startInfo = new ProcessStartInfo("devcon64.exe");
startInfo.Arguments = "restart =display *";
Process.Start(startInfo);
}
else
{
ProcessStartInfo startInfo = new ProcessStartInfo("devcon32.exe");
startInfo.Arguments = "restart =display *";
Process.Start(startInfo);
}
}
}
}