Return to Tech/dotnet

Console Program

.NET(C#)ぷろぐらみんぐ
コンソールプログラムのサンプル
Visual Studioもしくは
.NET Framework SDKのcscで作成します

1. エディタ(notepad)で下記のソースを用意します。
file:Console.cs
using System;

namespace Console_Test {
 class Program {
  public static int Main(string[] args) {
   Console.WriteLine("Console_Testです");
   Console.WriteLine("引数の数 : {0}", args.Length);

   return 0;
  }
 }
}

2. コンパイル
C:>csc Console.cs

3. 実行してみる
Dos窓でConsole.exeを実行。
下の結果が表示されます。


簡単ですが
.NET(C#)でコンソールプログラムをゼロから作る
手順を書いてみました

Return to Tech/dotnet