Thanks for your help.
Simon
-Original Message-
From: Richard Birkby [mailto:[EMAIL PROTECTED]]
Sent: 07 May 2002 12:09
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] Convert Hex to Decimal
UInt32 MyInt=System.UInt32.Parse(textBox1.Text, NumberStyles.HexNumber);
Richard
> -Origi
You need to call uint.Parse():
uint i = uint.Parse(textBox1.Text,
System.Globalization.NumberStyles.AllowHexSpecifier);
Note that this method expects the plain number
- eg. "20" will convert to 32, while "0x20" will throw an exception
so you will want to check and strip off any leading "0x" f
UInt32 MyInt=System.UInt32.Parse(textBox1.Text, NumberStyles.HexNumber);
Richard
> -Original Message-
> From: dotnet discussion [mailto:[EMAIL PROTECTED]]On Behalf Of
> Powell, Simon
> Sent: 07 May 2002 11:07
> To: [EMAIL PROTECTED]
> Subject: [DOTNET] Convert Hex t
Hi,
I have a text box that excepts a hex value. How do I then convert to uint32
to pass to an API?
Below is a code snippet:
private void button1_Click(object sender, System.EventArgs e)
{
if(this.textBox1.Text == "")
{