check this simple source code(C#) csharp.net-informations.com/communications/csharp-ip-address.htm algo.
Separate names with a comma.