Jump to content

ip address - Get first 2 bytes


spymare
 Share

Recommended Posts

Try this method:

$ip = "192.322.32.34"
$aOctets = StringRegExp($ip, "^(\d+\.\d+)", 3)
MsgBox(0, "IP", "1st 2 octets of " & $ip & " = " & $aOctets)

Br,

UEZ

Edit: I did not read carefully the 1st post Posted Image

Edited 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

thx it works :graduated: 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")

Else

MsgBox(16,"Error","You computer is not connected to System Biologi network")

endif

Edited by spymare
Link to comment
Share on other sites

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...