Accurately Detect Operating System Version In C#

.Net's Environment.OsVersion object gives us the version information of the OS we are running under - its Platform property gives us the OS family and we can then use the Version property to narrow down the specific OS. This article from Microsoft outlines a function that detects the curren... [More]

Nunit Doesn't Refresh References

Update: I found today that if you load the options dialog of Nunit and tick 'Disable Shadow Copy (default: Enabled)' Nunit correctly loads the latest references. You need to unload the test project from Nunit when building the dll in Visual Studio to release Nunit's lock on the file. M... [More]

Exposing Child Control Events In A User Control

Sometimes we want to add handlers to events raised by children of a User Control. As far as I could google these are your options. 1. The  simplest way is to provide an accessor method that returns the control. Chances are if you only expose certain properties of your child control, develo... [More]

Ping In C# .Net

This is probably old news to most people but I ended up googling for it so I'll record it here. Since .Net 2.0 there is a handy Ping class in the System.Net.NetworkInformation namespace that encapsulates - you guessed it - ping functionality. Here's some example code for performing a synch... [More]
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010