Well, it may be useful to know where in the process it stops working.
In a terminal try typing the following two commands:
sudo iwconfig wlan0
sudo ifconfig wlan0
The first one should show the router's SSID and MAC address - if it says "not associated" then it didn't even get that far.
If it associates the second line will tell you whether it managed to get and IP address via DHCP.
What router model is it (in case it makes any difference).
For example, I have
wlan0 IEEE 802.11bgn ESSID:"not telling"
Mode:Managed Frequency:2.472 GHz Access Point: 00:xx:xx:xx:xx:xx:xx
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.xxx.xxx netmask 255.255.255.0 broadcast 192.168.xxx.255
But with the wireless off:
wlan0 IEEE 802.11bgn ESSID:off/any
Mode:Managed Frequency:2.472 GHz Access Point: Not-Associated
wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 00:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet)