Autor Beitrag
kostonstyle
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 94



BeitragVerfasst: Do 11.08.11 11:28 
Hallo miteinander
wie kann ich überprüfen, ob die IP Adresse innerhalb eines Ranges liegt.
Beispiel, ich habe eine IP adresse von 192.168.25.136
Range1 192.168.20.1
Range2 192.168.25.255
Nun möchte ich überprüfen, ob meine IP Adresse innerhalb diese zwei ranges liegt....

Gruss kostonstyle


Moderiert von user profile iconTh69: Topic aus C# - Die Sprache verschoben am Do 11.08.2011 um 11:43
Trashkid2000
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 561
Erhaltene Danke: 137



BeitragVerfasst: Do 11.08.11 11:52 
Hallo,

naja, ich würde es mit einem regulären Ausdruck machen.
Einfach die Ip in ihre vier Teile zerpflücken, und dann jeden Teil gegen die untere Grenze und obere Grenze prüfen.

LG
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4799
Erhaltene Danke: 1059

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Do 11.08.11 11:56 
Hallo,

unter codeguru.earthweb.co.../article.php/c10651/ gibt es eine Hilfsklasse dafür, u.a. mit den Methoden IsGreaterOrEqual und IsLessOrEqual.
kostonstyle Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 94



BeitragVerfasst: Fr 12.08.11 09:36 
vielen dank....