C# convert int to hex int
<p>Ok, so everyone says to use:</p>

<pre><code>// Store integer 182
int intValue = 182;
// Convert integer 182 as a hex in a string variable
string hexValue = intValue.ToString("X");
// Convert the hex string back to the number
int intAgain = int.Parse(hexValue, System.Globalization.NumberStyles.HexNumber);
</code></pre>

<p>But this doesn't work however. This is the answer everytime someone asks, but when I do this, my integer still gets converted back to decimal.</p>

<p>This isn't a duplicate question because every other question had the wrong answer because this doesn't actually work. What is the real way to convert an int into a hex int? Doing this just keeps intAgain as decimal 182.</p>