Sign in to follow this  
Followers 0
Kkweit

Display the Subnet Mask

6 posts in this topic

Hi,

Sorry to bother you with something which might seems to be so simple but i can't find a way to display de subnet mask of a computer.

I tried different thing but none of them worked.

Is there somebody who can help me ?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

The subnet-mask is network-specific (one pc can have multiple adapters each in another network): http://www.autoitscript.com/forum/index.php?showtopic=95901&view=findpost&p=689749

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks for your help.

I'm sorry to say that but I'm real newbie with AutoIt and I don't know what part extract from your code to got it works !

Edited by Kkweit

Share this post


Link to post
Share on other sites

You will need everything. The information you need is fetched between

If Not @error Then (line 61)

and

ConsoleWrite($XML & @CRLF)(line 98)

The subnet mask is fetched here:

$XML &= _GetAllIPsXML(DllStructGetPtr($adapter, "IpAddressListNext"), "IP", False)

To get a simple array with all IPs and subnetmasks, use

$aIPs = _GetAllIps(DllStructGetPtr($adapter, "IpAddressListNext"))

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I add those lines to your script

$aIPs = _GetAllIps(DllStructGetPtr($adapter, "IpAddressListNext"))

MsgBox(64,"Resultat du test permettant d'etablir un diagnostic de votre machine", & $aIPs)

and i get the following message:

Error:Variable used without being declared.

This message is for the first one !( of the two lines)

Edited by Kkweit

Share this post


Link to post
Share on other sites

In the example, I added Opt("MustDeclareVars",1). So you have to declare all variables before you can assgn a value. (or remove that line)

Also, $aIPs is an array, so your MsgBox wont't work, You can try _ArrayDisplay instead.


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
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
Sign in to follow this  
Followers 0