Hi,
I not sure whether there is a hex class in .NET.
But this is how i do:
String -> Char[] -> Byte[] -> Hex (to display)
// convert string to character array
char [] keyValue = KeyTextBox.Text.ToCharArray();
// convert character array to byte array
byte [] keyByte = Encoding.ASCII.GetBytes(keyValue);
// Format the byte into hexadecimal
string str = "";
str += string.Format("{0:x2}", keyByte[i]);
To convert Hex back to Bytes:
you can look into Byte.Parse(,);
Correct me if i am wrong. Thanks.
--
Regards,
Chua Wen Ching :)
"BuddyWork" wrote:
Hello Tamir,
I need to convert a string to byte[] which is what the
function DecodeHexString() does.
Thanks,
-----Original Message-----
Why just not to
MyString = Int64.Parse
(MyValue,System.Globalization.NumberStyles.HexNumb er)?
--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "
"BuddyWork" <an*******@discussions.microsoft.com> wrote
in messagenews:24*****************************@phx.gbl... Hello,
Does anyone know where the class Hex is in the framework. According to articles that I read it should be in
System.Security.Util, but I cannot find the Util
namespace.
Here is the link that shows this.
http://dotnet.di.unipi.it/Content/ss.../doxygen/fx/bc l/hex_8cs-source.html
.