What you are trying to implement is called DRM, presumably in an attempt to prevent people from running copies of your software that have not been registered.
It's a losing battle. No matter how you implement it, the end result is that somewhere in your code you will have something like this:
if (authenticationSucceeded) {
// Allow access to program
} else {
// Show error and quit.
}
All someone has to do is to decompile this function, insert a !
in the if statement and recompile it again (or modify the intermediate language code directly). If they do this then they will have broken your security.
With this in mind, you might as well use a very simple, cheap to implement system. Just have list of plain-text registered keys on your server and have the client send their key over HTTPS (to prevent eavesdropping). Adding more security than this is probably not worth it as it will be so trivial to workaround anyway as described above.
Update: The poster says in a comment that the program is useless without access to a remote database. In this case it can make sense to prevent unauthorized use of the software, or more precisely - to prevent unauthorized access to your database. You can use WCF to make a secure connection to the server and require sending your username and password-hash before allowing access to the rest of the interface. If the the username/password is not correct the server will disallow further calls to your service. On the server you can store the allowed usernames and password hashes in the database.