so erstellen Sie eine exe-Datei von meiner erstellten Datei(.cs-Datei)?

Dieser C# - code ist für die Durchführung einer Winform-Anwendung, die habe ich zusammengeführt. Ich will erstellen Sie eine exe-Datei aus C# - code.

Wie kann das getan werden?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public static class Program
    {
    ///<summary>
    ///The main entry point for the application.
    ///</summary>
    [STAThread]
    static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new Form1());
    }
}

public class Form1 : Form
{
    ///<summary>
    ///Required designer variable.
    ///</summary>
    private System.ComponentModel.IContainer components = null;

    ///<summary>
    ///Clean up any resources being used.
    ///</summary>
    ///<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    {
        if (disposing && (components != null))
        {
            components.Dispose();
        }
        base.Dispose(disposing);
    }
    public Form1()
    {
        InitializeComponent();
    }

    #region Windows Form Designer generated code

    ///<summary>
    ///Required method for Designer support - do not modify
    ///the contents of this method with the code editor.
    ///</summary>
    private void InitializeComponent()
    {
        this.components = new System.ComponentModel.Container();
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.Text = "Form1";
    }

    #endregion
}

}

  • Haben Sie versucht, mit einer C# - compiler (csc.exe)?
  • Ich bin davon ausgegangen, dass Sie visual studio nicht installiert ist ? Holen Sie Visual C# 2010 Express von Microsoft. Seine frei!
  • sorry ... aber ich weiß, was Sie mir sagen ... also ich kenne IDE wie VS oder alles und wie es zu benutzen !!! Ich möchte, dass mein C# - winform erzeugen eine exe-Datei! OK?! ... eigentlich ... ich will zu produzieren, die exe-Datei aus meinem Projekt(windows form Anwendung) !!! ... Ich bin momentan dabei, ein Programm wie visual studio erstellen können als exe-Datei... aber so einfacher als VS!!! Ich möchte etwas code zu produzieren exe-Datei von meiner Datei, die ich schrieb in meinem ersten post!!!!!!
  • Ich denke, Sie wollen das erstellen von C# - code aus der app. Schauen Sie hier: stackoverflow.com/questions/7264682/...
InformationsquelleAutor amir-yeketaz | 2011-10-05
Schreibe einen Kommentar