Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   how can I check the IP address the user inputs is correct ?? (http://forums.winamp.com/showthread.php?t=258814)

jaylun 3rd November 2006 02:24

how can I check the IP address the user inputs is correct ??
 
the setup needs the user inputs the ip of the server,i can save the ip the user inputs to Var $R0,but i don't know how to check the ip fomat is correct

kichik 3rd November 2006 09:50

You can use CheckIP.

bholliger 3rd November 2006 09:55

Hi!

Here you are:

http://nsis.sourceforge.net/Docs/AppendixE.html#E.3.16

VersionCompare YourIP 1.1.1.1 $var ; $var=1 Version1 is newer
- and -
VersionCompare YourIP 255.255.255.255 $var ; $var=2 Version2 is newer

might be a solution.

Cheers

Bruno

kichik 3rd November 2006 09:57

That won't work because 1.1.1.500 is "newer" than 1.1.1.1, but "older" than 255.255.255.255 and it's still invalid.

bholliger 3rd November 2006 09:59

Hi!

As far as I can see CheckIP considers everything else than LanIP, APA or Loopback as an internet address. There's no validation.

Do you agree?

Cheers

Bruno

kichik 3rd November 2006 10:50

You're right. It doesn't really validate the IP. I've created ValidateIP which should take care of that.

bholliger 3rd November 2006 10:56

Hi!

Perfect. Thank you very much!

Cheers

Bruno


All times are GMT. The time now is 04:32.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.