Some useful method for .net  C#