Open C:\Windows\system32\drivers\etc\Hosts file in your notepad by right clicking on notepad and selecting run as administrator.
Check that you have this entry at the top of the list of uncommented entries.127.0.0.1 localhost
If not then add the line as the first line in the list.
If you find this entry:
then comment it out so it looks like this
# ::1 localhost
Save the file and try to access http://localhost
If you have many entries in the hosts file and you have not added them then perhaps it is time to look for a virus or a Trojan that may be interfering with the hosts file - if you know how then after editing the file make it read only.