First of all, check your router box. It usually comes with the correct aaa.bbb.ccc.ddd IP address written on the side or it is included in the documentation. If you have thrown this away, you could try any of these suggestions before ringing up your internet provider and follow their instructions on how to reset it. Connect a computer to a wired connection on the router. Usually you need to be connected by Ethernet. Point your browser at http://192.168.1.1/ - this should take you to the administration interface of the router where you may be able to see the code. Even if this is not possible, you can do a hard reset on the router. This may involve having to use a paperclip or something thin to push and hold the button which will restore the factory default settings. However, this is not necessarily recommended as it may mean you lose your wireless security settings. Also, if you do this, remember that you will need to change the password on all the computers that use your wifi. If you have a PC that is connected via wireless to the internet, you can download and run a program called Wireless Key View which will recover all WEP/WPA keys saved in your computer. Many people find this successful but you may want to check with your provider first. Another possibility is to try to access your keychain, which should contain the password. Open the keychain application in utilities and look for an item that has the name of your wireless network. If you are unsure or do not like the sound of any of these options then do contact your provider. I am sure they are asked this question many times a day and should be able to talk you through it. And when they have done so, write the code down!
This question is too vague (as indicated by the wide variety of answers so far). Please be more specific. You say 'I forgot my wifi code on my computer', what wifi code? The access code to get online wirelessly through your router? Some code to access the wifi function on your computer? What wifi code?
Answering that will make useful answers much easier for us to give... (^_^)
Good luck and have a good day.
The code is on the bottom of your router.
Look at the bottom if you have a laptop if computer look in the manual or go online to the type of computer then look at the right 1.