Assuming, you have a unique code for each username.
Use C#
Dictionary<TKey,TValue>
, and add you codes as keys and usernames as values into the dictionary.
Your dictionary will look something like:
Key Value
123 ChrisHD22
846 ChrisCreateBoss
067 Unknown
By doing this, you can search for key entered in the textbox and fetch the its corresponding value from the dictionary.
Check the links below to see how it works:
https://msdn.microsoft.com/en-us/library/xfhwa508%28v=vs.110%29.aspx[
^]
http://www.dotnetperls.com/dictionary[
^]