Please, make your mind up: VB and C# are very different languages, and code for one will not compile for the other...
In any case, Google is your friend here:
Google: "Licence key application c#"[
^] will find you loads, including this from this very site:
License Key Generation[
^]
In future, please try to do at least basic research yourself, and not waste your time or ours.