You can generate a hash as part of the serial number, and check if the hash is correct in the game. If you want to make sure that only one copy of the game can be activated with one serial number, you'll have to set up a server to validate serial numbers online.
Just be aware that these copy protection methods are not very strong, and it will be quite easy to hack your game.