I know that this post isn't in the c# section, but what's the C# way of doing this exact thing?