開発環境 |
メモ帳 |
実行環境 |
Windows 7 Home Premium (32bit) |
参考
FormTest2.cs
// FormTest2.cs
using System;
using System.Drawing;
using System.Windows.Forms;
public class Form1 : Form
{
private Button button1;
private int count = 0;
public Form1()
{
Width = 200;
Height = 80;
Text = "FormTest2";
button1 = new Button();
button1.Location = new Point(10, 10);
button1.Size = new Size(170, 30);
button1.Text = "Push here.";
button1.Click += new EventHandler(button1_Click);
Controls.Add(button1);
}
private void button1_Click(object sender, EventArgs e)
{
count++;
button1.Text = count.ToString();
}
}
static class Program
{
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
コンパイル手順
D:\tmp>csc
'csc' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
D:\tmp>path %path%;C:\Windows\Microsoft.NET\Framework\v4.0.30319
D:\tmp>csc /t:winexe FormTest2.cs
Microsoft (R) Visual C# Compiler Version 4.0.30319.18408
for Microsoft (R) .NET Framework 4.5
Copyright (C) Microsoft Corporation. All rights reserved.
最終更新:2014年08月12日 14:30