Reading GPIO values on the Raspberry Pi in C#

So, after some distraction due to fiddling with H2D2 and reading my new book on programming TCP/IP sockets :-) I've finally gotten round to testing the getting of GPIO values in C# on my Raspberry Pi with the help of the libpigpio shared C library which I slapped together. Also, in the meantime I've tested out libpigpio on Debian Wheezy which seems fine.

I'm happy to report that it seems to work great, here is the C# test program I used:

using System;
using System.Threading;
using LibPiGpio;
 
namespace RPiBlinky
{
    class Program
    {
        static void Main(string[] args)
        {
            RpiGpio.SetOutputPins(new[] { 7 });
            RpiGpio.SetInputPins(new[] { 17 });
 
            while (!Console.KeyAvailable)
            {
                RpiGpio.Pins[7] = RpiGpio.Pins[17];
                Thread.Sleep(10);
            }
            Console.ReadKey();
        }
    }
}

....which sets the value of one GPIO based on the value of another. I hooked up a button and an LED like I did before, so pressing the button makes the LED come on. That code makes it look pretty easy doesn't it?

Anyway, the next thing is to expose this stuff to a browser, so that GPIO values can be read/written over the internet. I'm working on that... I just need to tear myself away from TCP/IP sockets and programming language design long enough.