Jump to content

Need your comment about my program


 Share

Recommended Posts

Hi, This is my first post here. Sorry for my poor english.

I known autoit from computer book on thailand yesterday

Below code is my first program that make from my learning on help file.

#NoTrayIcon

$ip = InputBox("PING IP BY JIRAPATH SSP","ENTER IP")

$result = ping ($ip)

if $result Then

msgbox(0, "STATUS", "PING "&$ip)

Else

msgbox(0, "STATUS", "NOT PING "&$ip)

EndIf

I would like to ask your comment to improve belong my idea.

1. popup for receive third and fourth number of ip such as 172.30.X.Y. I always use ping ip 172.30....... .

so that I want to only enter third number then press enter for next popup for fourth number.

my own idea to merge third and fourth number to 172.30. as $ip as above my program. But I can't find function about merge string.

2. If I can ping ip, program will show computer name of ping ip such as you use command nbtsta -a ip on cmd command mode.

How can I adapt @computerName for my requirement.

Thank you for your comment

Regards,

Mbell

Link to comment
Share on other sites

0. Use "code" instead of "quote" to post a code fragment.

1. &

$var1 = "Welcome"
$var2 = "in"
$var3 = "Autoit"
$var4 = "Forum"
MsgBox(0,"",$var1 & $var2 & $var3 & $var4)

2. I don't get what u mean

Edited by 4ggr35510n
Link to comment
Share on other sites

You might want to check out the functions of the GuiIPAddress.au3 UDF, especially _GuiCtrlIPAddress_SetRange() and _GuiCtrlIPAddress_Get():

#include <GuiConstantsEx.au3>
#include <GuiIPAddress.au3>

Global $hgui, $hIPAddress, $idButton, $sIPAdx

$hgui = GUICreate("IP Address Control Set Range Example", 300, 150)
$hIPAddress = _GUICtrlIpAddress_Create($hgui, 10, 10)
$idButton = GUICtrlCreateButton("SELECT", 100, 100, 100, 30)
GUISetState(@SW_SHOW)

; set range on 1st two fields
_GUICtrlIpAddress_Set($hIPAddress, "172.30.0.0")
_GUICtrlIpAddress_SetRange($hIPAddress, 0, 172, 172)
_GUICtrlIpAddress_SetRange($hIPAddress, 1, 30, 30)

; GUI message loop
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit

        Case $idButton
            $sIPAdx = _GUICtrlIpAddress_Get($hIPAddress)
            MsgBox(64, "Selected", "Address selected = " & $sIPAdx)
    EndSwitch
WEnd

:blink:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...