Give IP Address in one variable

Windows specific forum
omid-xp
Enthusiast
Enthusiast
Posts: 119
Joined: Tue Jan 27, 2004 2:17 pm

Give IP Address in one variable

Post by omid-xp »

How can i give Ip address in one variable?

i really need to this.

thanks.
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Post by merendo »

MakeIPAddress(field1,field2,field3,field4)

Please read the manual.
The truth is never confined to a single number - especially scientific truth!
omid-xp
Enthusiast
Enthusiast
Posts: 119
Joined: Tue Jan 27, 2004 2:17 pm

Post by omid-xp »

Thanks merendo but i want give current machine IP adress and then set it in a varible.

i no want make one fake ip address.

i must use one API for it ? or winsock ? or....

i need to this source.

thanks.
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post by sec »

Code: Select all

InitNetwork()
b1.s=Hostname()
r1.l=gethostbyname_(@b1)
r2.l=PeekL(PeekL(PeekL(r1+12)))
Debug r2 ; what do you need?
Debug IPString(r2) ;ipv4 with dot
omid-xp
Enthusiast
Enthusiast
Posts: 119
Joined: Tue Jan 27, 2004 2:17 pm

Post by omid-xp »

thanks sec for source code.
Joey
New User
New User
Posts: 7
Joined: Thu Mar 18, 2004 10:09 pm

Post by Joey »

Is this what u meant? Cause my code puts local IP address straight to a variable if thats what u meant

Code: Select all

InitNetwork()
InitNetwork()
  ExamineIPAddresses()
  AA$ = IPString(NextIPAddress())
  MessageRequester("Local IP", "Local IP Address is : "+AA$+" ",#PB_MessageRequester_Ok)
                  
I put a message requester in there just to prove it works :P

If you want the IP address in Long form etc just take out the IPString() and make the variable a long, you prob knew that so sry.
Post Reply