If your are connecting to a router via a wire (Ethernet cable) you might need to upgrade your network card (chip) drivers. Use another computer with internet to get the drivers.
Try another cable.
Also, an antivirus could be causing that issue.
Check that the TCP/IPv4 is obtaining an IP address automatically from DHCP.
You could manually set static IP address, by typing the IP address. subnet mask and DNS.
I recently formatted my PC, and I can't connect to any networks, except for one which is unidentified and has no network connection.
It's an old eMachines desktop. I could connect before, but why is it doing this now?
Delete/remove the offending network connection from the list of available connections...re-scan for available networks...pick yours and option it as the preferred connection...make sure to turn off the Windows option to scan and connect to available networks in the internet options.