| Platform | Windows API (WinAPI) | .NET Framework and Windows Forms | Windows Presentation Foundation (WPF) | Windows Universal Platform (UWP) |
|---|---|---|---|---|
| Year Introduced | 1985 | 2002 | 2006 | 2012 |
| Programming Languages | C, Visual Basic | C#, VB.NET, J#, Managed C++ | C#, VB.NET, F#, C++/CLI | C#, VB.NET, F#, C++/CX, JavaScript/HTML |
| Platforms | Windows 1 → NT | Windows 98 → XP | Windows Vista → 7 | Windows 8 → 10 |
using System;
namespace HelloCSharp
{
class Hello
{
static void Main(string[] args)
{
for (int i = 0; i < 10; i++)
{
Console.WriteLine("Hello, C#!");
}
}
}
}
static void Main() method, which is
the first method executed
Hello.cs
HelloCSharp.exe which can be executed by the CLR
HelloCSharp.exe by running the ildasm (IL Disassembler) tool
from the Visual Studio Command Prompt
.method private hidebysig static void Main(string[] args) cil managed
{
.entrypoint
// Code size 30 (0x1e)
.maxstack 2
.locals init ([0] int32 i,
[1] bool CS$4$0000)
IL_0000: nop
IL_0001: ldc.i4.0
IL_0002: stloc.0
IL_0003: br.s IL_0014
IL_0005: ldstr "Hello, C#!"
IL_000a: call void [mscorlib]System.Console::WriteLine(string)
IL_000f: nop
IL_0010: ldloc.0
IL_0011: ldc.i4.1
IL_0012: add
IL_0013: stloc.0
IL_0014: ldloc.0
IL_0015: ldc.i4.s 10
IL_0017: clt
IL_0019: stloc.1
IL_001a: ldloc.1
IL_001b: brtrue.s IL_0005
IL_001d: ret
} // end of method Hello::Main