hi,
here i am write the code for decimal value to hex value.Now my requirement is how to convert hex value to decimal value using windows application code in c#.Please find this code as given below.
thank u
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manish Kumar ChoudharyPosted Dec 4, 2014, 3:22 AM
plz accept the ans incase it helps u.
Thanks
Naidu AMMANPosted Dec 4, 2014, 3:05 AM
Manish Kumar ChoudharyPosted Dec 4, 2014, 3:00 AM
string hexValue = textBox1.Text;//.ToString("X");
Naidu AMMANPosted Dec 4, 2014, 2:53 AM
how to convert each of them separately sir.
Manish Kumar ChoudharyPosted Dec 4, 2014, 2:37 AM
It's possible but you have to extract particular string from that textbox. Means to say u have to take every value of string inside textbox when space came and convert each of them separately convert. accept the ans if it help uNaidu AMMANPosted Dec 4, 2014, 2:32 AM
sir we can given "7e" it show the 126.
when i am giving the "7e a0 2b 41" its getting error in
int decValue = int.Parse(hexValue, System.Globalization.NumberStyles.HexNumber);
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll.
sir it possible to show this data like this "7e a0 2b 41"
Manish Kumar ChoudharyPosted Dec 4, 2014, 2:19 AM
find the attachment and check it may help u
Naidu AMMANPosted Dec 4, 2014, 2:11 AM
Naidu AMMANPosted Dec 4, 2014, 2:07 AM
Manish Kumar ChoudharyPosted Dec 4, 2014, 2:02 AM
it it work for u ?
Manish Kumar ChoudharyPosted Dec 4, 2014, 1:48 AM
int decValue = Convert.ToInt32(hexValue, 16);
Naidu AMMANPosted Dec 4, 2014, 1:45 AM
Manish Kumar ChoudharyPosted Dec 4, 2014, 1:36 AM
To convert from Hex to Decimal do either...
int decValue = int.Parse(hexValue, System.Globalization.NumberStyles.HexNumber); or
int decValue = Convert.ToInt32(hexValue, 16);