Sign in to follow this  
Followers 0
pcjunki

read from combo, launch site determined from the data in the combo

4 posts in this topic

I have a gui, with predefined data that populates in a combo

on a side note, we have a web database that tracks all our assets

so if I click on pc1 I want it to goto http://server117:8080/wsId=108039

pc2 has another wsid number

how should I store/configure the computer names with the wsid numbers?

ini file?

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


$Form1 = GUICreate("Form1", 615, 438, 192, 124)
$Input1 = GUICtrlCreateCombo("", 40, 56, 169, 21)
GUICtrlSetData(-1, "||PC1|PC2|PC3")
$web = GUICtrlCreateButton("web", 152, 104, 81, 57)
GUISetState(@SW_SHOW)




While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $web
            $pc = GUICtrlRead($Input1)

    EndSwitch
WEnd

Share this post


Link to post
Share on other sites



how should I store/configure the computer names with the wsid numbers?

 

However you want.

It is a very open-ended question. Perhaps you meant to ask, "what are the different ways I can store this information? And when would I choose one over another?". We need more information from you.

To answer your unasked question - Based on the number, and complexity, you could store in:

  • an array in the script
  • an ini file
  • a sqlite database
  • an excel spreadsheet
  • a text file
  • an a dozen other methods, just off the top of my head.

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I'd like to try an ini file

allot of working building it, but it will so be worth it, I'm reading the help files and editing my script now to read from it, and what not

so my ini file is...

[pc1]

link=http://server117:8080/wsId=108039

[pc2]

link=http://server117:8080/wsId=108040

[pc3]

link=http://server117:8080/wsId=108055

so on and so on.... now I just need to get ie shell execute to that link

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

think I got it

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $web
            $pc = GUICtrlRead($combo1)
            $sRead = IniRead(@DesktopDir & "\asset.ini", $pc, "link", "")

            ShellExecute($sRead)

    EndSwitch
WEnd
Edited by pcjunki
1 person likes this

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