spymare Posted December 3, 2010 Share Posted December 3, 2010 HI. with _getip() or @ipaddress1 i can get my ip like this : 192.322.32.34 Is it possible somehow to get only the first 2 bytes? like 192.322 ? Link to comment Share on other sites More sharing options...
hannes08 Posted December 3, 2010 Share Posted December 3, 2010 Hi spymare, use StringSplit(): $arrayTemp = StringSplit("192.168.1.1",".") $sFirstTwoBytes= $arrayTemp[1] & "." & $arrayTemp[2] Regards, Hannes Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
UEZ Posted December 3, 2010 Share Posted December 3, 2010 (edited) Try this method:$ip = "192.322.32.34" $aOctets = StringRegExp($ip, "^(\d+\.\d+)", 3) MsgBox(0, "IP", "1st 2 octets of " & $ip & " = " & $aOctets)Br,UEZEdit: I did not read carefully the 1st post Edited December 3, 2010 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
spymare Posted December 3, 2010 Author Share Posted December 3, 2010 (edited) thx it works but i need to get the ip address through _getip(), else i can do it like this:if $sFirstTwoBytes Then$outlook = _RunDos("start outlook.exe /c ipm.note /m helpdesk@bio.dtu.dk") ElseMsgBox(16,"Error","You computer is not connected to System Biologi network")endif Edited December 3, 2010 by spymare Link to comment Share on other sites More sharing options...
spymare Posted December 3, 2010 Author Share Posted December 3, 2010 can anyone help me with this error when im not connected to internet i get a error (ipconfig /release) #include <Process.au3> #include <Inet.au3> #include <Array.au3> $test = (_getip()) $arrayTemp = StringSplit($test,".") $sFirstTwoBytes= $arrayTemp[1] & "." & $arrayTemp[2] if $sFirstTwoBytes Then $outlook = _RunDos("start outlook.exe /c ipm.note /m helpdesk@bio.dtu.dk") Else MsgBox(16,"Error","You computer is not connected to System Biologi network") endif Link to comment Share on other sites More sharing options...
UEZ Posted December 3, 2010 Share Posted December 3, 2010 Try this: #include <Process.au3> #include <Inet.au3> #include <Array.au3> $get = (_getip()) $chk_ip = "192.222" $aOctets = StringRegExp($get, "^(\d+\.\d+)", 3) if $get = $aOctets[0] Then $outlook = _RunDos("start outlook.exe /c ipm.note /m helpdesk@bio.dtu.dk") Else MsgBox(16,"Error","You computer is not connected to System Biologi network") endif Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
spymare Posted December 6, 2010 Author Share Posted December 6, 2010 not working :/. tryed something like this :S: $what = ("292.38.13.111") $arrayTemp = StringSplit($what,".") $test = $arrayTemp = (_getip()) $sFirstTwoBytes = $arrayTemp[1] & "." & $arrayTemp[2] $test if $sFirstTwoBytes then $outlook = _RunDos("start outlook.exe /c ipm.note /m helpdesk@bio.dtu.dk") Else MsgBox(16,"Error","You computer is not connected to System Biologi network") endif Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now