Jump to content

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


pcjunki
 Share

Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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

Link to comment
Share on other sites

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
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...