i want to find my IP.
(sure with masm32)
(sure with masm32)
It's simple, get the IP of the domain name "localhost", works in every programming languaje (that supports sockets) in any Windows version... :)
Don't you know it?
127.0.0.1
:grin: :grin: :grin:
127.0.0.1
:grin: :grin: :grin:
It's simple, get the IP of the domain name "localhost", works in every programming languaje (that supports sockets) in any Windows version... :)
i was try that but it is not worked...
inet_ntoa(inet_addr("localhost"))
th return value is "255.255.255.255"
Don't you know it?
127.0.0.1
:grin: :grin: :grin:
I presume you are joking :grin:
However, it's a way to know if you're connected to the internet or not. Attempting to retrieve the address of localhost returns 127.0.0.1 if not connected, and my real IP if I am (at least at home I've seen it work so... I have Win98 and a dialup connection).
i was try that but it is not worked...
inet_ntoa(inet_addr("localhost"))
th return value is "255.255.255.255"
I think you should lookup "localhost" as if it were a domain name...
it's a way to know if you're connected to the internet or not. Attempting to retrieve the address of localhost returns 127.0.0.1 if not connected
ya that's right but only on dialup connections, but if any one using DSL, ISDN or any Internet line technology it will not work if u want to detect the internet use :
InternetGetConnectedState;
it work for types of connections
amr
To see what your ip is, run winipcfg.
Hi
LOL
To find out your ip, Ping www.google.com, run ipconfig, or even better call your ISP & they will tell you..
sorry guys I had to comment:grin:
Peace
To see what your ip is, run winipcfg.
LOL
To find out your ip, Ping www.google.com, run ipconfig, or even better call your ISP & they will tell you..
sorry guys I had to comment:grin:
Peace
Hi
LOL
To find out your ip, Ping www.google.com, run ipconfig, or even better call your ISP & they will tell you..
sorry guys I had to comment:grin:
Peace
mistronr1 's IQ=60
ok example:
; #################################################
.486
.model flat, stdcall
option casemap :none ; case sensitive
; #################################################
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\gdi32.inc
include \masm32\include\wsock32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\wsock32.lib
.data
myhostname db "localhost",0
.data?
wdat WSADATA <?>
getip PROTO
; #################################################
.code
start:
call getip
invoke ExitProcess,0
; #################################################
getip proc
invoke WSAStartup,101h,addr wdat
invoke gethostbyname,addr myhostname
mov eax, DWORD PTR [eax+12]
mov eax, DWORD PTR [eax]
mov eax, DWORD PTR [eax]
invoke inet_ntoa,eax
invoke MessageBox,0,eax,addr myhostname,MB_OK
invoke WSACleanup
ret
getip endp
; #################################################
end start