The DSi doesn't have a friend code, it is individual games that have them. To get the friend code for the game, you'd have to specify which games. For example you see your Final Fantasy 3 friend code if you use Mognet, and you get a friend code for the pokemon games when you use your Pal Pad.
To get your friend code, you must have Wi-Fi connection. Go to your town gate and talk to Copper (the dog on the right). When he asks you what you want, choose "Friend Code!" and he will follow a procedure and give you your friend code.
If you want friend codes, talk your friends into getting the game and have them give you their friend code. If you don't know your friend code, go to the MAIN GATE and talk to Copper. Click on the words "Friend Code." He'll tell you your friend code.