@nawalmir, you've just responded to a 7 year old post with an invalid solution. Your solution is a C++ solution and this is a C# forum.

Besides that, welcome to the site.