Sign in to follow this  
Followers 0
realkiller

ip to na converter

2 posts in this topic

i wanna make a ip to name converter so far i don't get any result i know i have done something wrong.

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.4.7
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
#include <array.au3>
#include <inet.au3>
#include <GUIConstants.au3>
Dim $aResult, $sIp, $ip, $sIps
GUICreate("IP 2 Computername")  ; will create a dialog box that when displayed is centered

$sIp = GUICtrlCreateInput ( "", 10,  5, 300, 20)
$ip = GUICtrlCreateButton ("Search",  10, 30, 100)




$sIps = ""
TCPStartup()
$aResult = _TCPIpToName ($sIp, 1)
If @error Then
    MsgBox(0, "_TCPIpToName()", "@error = " & @error & @LF & "@extended = " & @extended)
Else
    _ArrayDisplay($aResult, "Local Hostname(s)")
EndIf



GUISetState (@SW_SHOW)       ; will display an empty dialog box

; Run the GUI until the dialog is closed


While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
Case $msg = $ip
    $sIps = GUICtrlRead($sIp)
    EndSelect
Wend

Share this post


Link to post
Share on other sites



got it

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.4.7
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
#include <array.au3>
#include <inet.au3>
#include <GUIConstants.au3>
Dim $aResult, $sIp, $ip, $sIps
GUICreate("IP 2 Computername")  ; will create a dialog box that when displayed is centered

$sIp = GUICtrlCreateInput ( "", 10,  5, 300, 20)
$ip = GUICtrlCreateButton ("Search",  10, 30, 100)








GUISetState (@SW_SHOW)       ; will display an empty dialog box

; Run the GUI until the dialog is closed


While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
Case $msg = $ip

TCPStartup()
$aResult = _TCPIpToName (GUICtrlRead($sIp), 1)
If @error Then
    MsgBox(0, "_TCPIpToName()", "@error = " & @error & @LF & "@extended = " & @extended)
Else
    _ArrayDisplay($aResult, "Local Hostname(s)")
EndIf
    EndSelect
Wend

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