Hi All...(Particularly Original Griff!)
I have been battling a piece of hardware for some time, all I have left is to write out a value, I have manage to read from the <<Expletive Deleted>> smart card and write out to it. I have just seen the first bug If I write out a value of 255 or FF the system works. I now appear to be writing the number correctly however reading it back is the issue if I send 273 which is 111 in hex because of the oddities of this piece of hardware it needs to see it as 11100000 I have padded the string and all is well (that was due to some help by Orig. Griff and several others over Friday and this morning thanks to all) the issue now is I need to trim the string as when 11C00000 is read in it is interprited as 297795584
Value_Int = int.Parse(txtValueCredit.Text,System.Globalization.NumberStyles.HexNumber);
via that how ever the routine works fine for numbers that are less 255 (or FF!) over 255 it doesn't I am pretty sure it is to with the fact I am reading in reverse so any value that climbs over 255 such as 273 (111^16)is being read as 1110 or 11 10 and my the conversion routine above sees it as 1110 and gives 4368 how ever messing around I have found if the last character is removed with a Substring it works this does start to bother me though as the idea of chopping off a the last charcter seems a bit of a sledgehammer situation would I be better using an if to check for a 0 if its a 0 substring it if not treat it as part of the string for conversion. does that sound do-able, ah well off to the rain now I have finished for the day!
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)