M Mike Kitchen Apr 6, 2004 #3 Hi Use the following: string hex = "B1242AF2"; int n = Int32.Parse( hex, System.Globalization.NumberStyles.HexNumber ); Alternatively, the following will also work. string hex = "B1242AF2"; int myHex = Convert.ToInt32( hex, 16 ); See here for sample application http://www.publicjoe.f9.co.uk/csharp/snip/snip035.html Hope this helps Publicjoe C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html C# Snippets at http://www.publicjoe.f9.co.uk/csharp/snip/snippets.html
Hi Use the following: string hex = "B1242AF2"; int n = Int32.Parse( hex, System.Globalization.NumberStyles.HexNumber ); Alternatively, the following will also work. string hex = "B1242AF2"; int myHex = Convert.ToInt32( hex, 16 ); See here for sample application http://www.publicjoe.f9.co.uk/csharp/snip/snip035.html Hope this helps Publicjoe C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html C# Snippets at http://www.publicjoe.f9.co.uk/csharp/snip/snippets.html