hello.cs
cs
using System;
class Program {
static void Main() {
Console.WriteLine("Hello, World!");
}
}
编译
cs
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc /target:exe /out:hello.exe hello.cs
运行
cs
hello
显示
bash
Hello, World!
显示.NET版本
cs
Console.WriteLine(Environment.Version.ToString());