when i type localhost in direct connect it says Connection Refused: connection i dont know what this is. if you mean my localhost ip i dont know how to find that
local host ip is 127.0.0.1 ... make sure your server properties ip is left blank... do not set this as your hamachi address... lots of people make this mistake.
First try with your Hamachi ip, if that does not work try your localhost ip 127.0.0.1 If that does not work can you ask your friend to host the server.
I not sure you are asking the right question. localhost is always for the same machine only. It is an IP address that can only be accessed by the same machine you are running the server on and it is alway 127.0.0.1. The actual IP of the server on the local network look at your IP settings. If you are on windows use a command prompt and type in IPCONFIG. The next step is find the IP address you want to give your friend so he can connect. For that I recommend going to http://whatismyip.org/.
So in short for you to connect to your server if the server is running on the same machine you play on use either localhost (127.0.0.1) or local network of your server. For your friend they should use your external IP address found out at http://whatismyip.org/.
Anyway you go I DO NOT recommend ever putting an IP address in the server.properties file.
if i type IPCONFIG it opens cmd and it opens for 1 second and then it close and i dont know where i can find my local host ip then ( i know its 127.0.0.1 but i want to know the rest of my localhost ip)
The 127.0.0.1 is a fixed address and is only usable if you play on the same machine as the server. The IPCONFIG command will give you the local network IP for the server. You would use this to program port forwarding in your router and if you play on PC separate from the server.
OK.. so for you to connect to your server since you play on the same device you can use either 127.0.0.1 or the local network IP that you get from the IPCONFIG command. Your friend should use your external IP address that you get from http://whatismyip.org.