added C# version

Added a C# version, ready to be run in a Console Application project.
Used the JavaScript version as a base.