Archive

Archive for April, 2011

“Dot” Password Character in C#

April 26th, 2011 6 comments

When you are creating a password textbox, you could use the standard ‘*’ or ‘#’, however this does not look neat nor fall in line with the windows password character.

So I prefer to use ‘‚óŹ’, to implement this use the following code snippet:

this.fooBarTextBox.PasswordChar = '\u25CF';

Converting HEX Byte String to Byte

April 5th, 2011 Comments off

If you have a Byte that is actually stored in an ASCII string for instance "5E" and are wanting this to be converted to 0x5E you can perform one simple command.

using System

public byte HexStringToByte(string hexByte)
{
    return Byte.Parse(hexByte, NumberStyles.HexNumber);
}

There is a restriction with this however, there must be only one byte in the string. This could be extended quite easily to have a byte string of multiple hex bytes and return an array or list of bytes.

It has started!!!

April 3rd, 2011 Comments off
Categories: Uncategorized Tags:
%d bloggers like this: