c# format number with leading zeros

C#
Key = i.ToString("D2");
Source

Also in C#: