How can i process IP string?
How can i process the two strings with IP?
I need to calculate all the addresses like a network scanner from
192.168.11.1 to 192.168.11.255:

192.168.11.1
192.168.11.2
192.168.11.3
192.168.11.4
.....................

192.168.11.253
192.168.11.254
192.168.11.255

How can i do this?

i got one problem
i'l taking IP string from text box
and then i use this cycle :
invoke GetWindowText,hWndEditStartIP,addr HostIP,15
.WHILE dword ptr !=255
add dword ptr ,1
invoke MessageBox,0,addr HostIP,addr HostIP,MB_OK
.ENDW
then i got this:
192.168.11.1
192.168.21.1
.....................
192.168.91.1
192.168.:1.1
192.168.;1.1
192.168.<1.1
.....................
That the problem?
Posted on 2001-12-08 04:29:39 by Anorak
For myself, I would write a proc to convert the IP address into a DWORD, increate it from there, and then convert it back.
Posted on 2001-12-08 20:06:46 by huh

I need to calculate all the addresses like a network scanner from
192.168.11.1 to 192.168.11.255:

192.168.11.1
192.168.11.2
192.168.11.3
192.168.11.4
.....................

192.168.11.253
192.168.11.254
192.168.11.255

How can i do this?


hmmm try this:

include user32.inc
includelib user32.lib

.data
formatSTR db "192.168.11.%d",0
ipSTR db 256 dup(0)
ctr dd 1
..
..

.code
.WHILE ctr != 255
invoke wsprintf, ADDR ipSTR, ADDR formatSTR, ctr
; check the value of ipSTR:
invoke MessageBox, 0, ADDR ipSTR, ADDR ipSTR, MB_OK
add ctr, 1 ; Next IP
.ENDW


if you'll be taking the IP "192.168.11" from a textbox, simply add a ".%d" to it before wsprintf


clip
Posted on 2001-12-08 23:49:43 by clip