How to do it in C#?