DjDiabolik Posted December 12, 2010 Share Posted December 12, 2010 Hi boys.. i'm new and i have initiated to use AutoIt recently. Used google and the help in SciTe i still try to make a programs with this programs. I alredy know how it's possible to read/write information on .ini file and i have created a .ini like this: [SECTION1] Value1=xxxxxxx Value2=yyyyy Value3=aaaaaaa Value4=bbbbbb Value5=rrrrrr Value6=tttttt If it's possible i want to obtain a multiconfiguration.... like a listbox how all SECTIONx it's listed and it's possible to chose one of this. How it's possible to ADD more SECTION or delete it. Every one SECTIONx it's configurated i want to add the possibily to edit all value in a like inputbox or other thing. How it's possibly to obtain a similar thing ? Link to comment Share on other sites More sharing options...
water Posted December 12, 2010 Share Posted December 12, 2010 Welcome to AutoIt and the forum!A really great tool to edit a ini file is this My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
DjDiabolik Posted December 12, 2010 Author Share Posted December 12, 2010 (edited) I don't need how create ini file... but i need how can be read multi section from this ini file... and if it's possible to chose one of this from a menù or list of choice. *EDIT* Ok... for 1.0 i have decided to not use the multiconfiguration. I have choose to use single configuration.... this is the code i used: $Form2 = GUICreate("Menù di Configurazione", 277, 200, 293, 315) $IPAddress1=IniRead (".\config.ini", "CONFIG", "Ip", "") $Input1=IniRead (".\config.ini", "CONFIG", "Username", "") $Input2=IniRead (".\config.ini", "CONFIG", "Password", "") $Input3=IniRead (".\config.ini", "CONFIG", "HttpPort", "") $Input4=IniRead (".\config.ini", "CONFIG", "FtpPort", "") $IPAddress1 = _GUICtrlIpAddress_Create($Form2, 8, 24, 113, 25) _GUICtrlIpAddress_Set($IPAddress1, "0.0.0.0") ;_GUICtrlIpAddress_Set($IPAddress1) $Input1 = GUICtrlCreateInput($Input1, 8, 72, 113, 21) $Input2 = GUICtrlCreateInput($Input2, 8, 120, 113, 21) $Input3 = GUICtrlCreateInput($Input3, 152, 72, 113, 21) $Input4 = GUICtrlCreateInput($input4, 152, 120, 113, 21) $Label1 = GUICtrlCreateLabel("DreamBox IP", 32, 8, 66, 17) $Label2 = GUICtrlCreateLabel("UserName", 40, 56, 54, 17) $Label3 = GUICtrlCreateLabel("Password", 40, 104, 50, 17) $Label4 = GUICtrlCreateLabel("HTTP Port (Default:80)", 152, 56, 113, 17) $Label5 = GUICtrlCreateLabel("FTP Port (Default:21)", 152, 104, 104, 17) $Button1 = GUICtrlCreateButton("Salva Configurazione", 72, 160, 113, 33) Before to load i have read from ini file the configuration........ but i can't found a solution for Ip Address..... it's possibly to import it from ini file like Other value ? Edited December 12, 2010 by DjDiabolik Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 12, 2010 Moderators Share Posted December 12, 2010 DjDiabolik,You can get a list of the Section titles using IniReadSectionNames. If you put that list into a combo you can then get the user to choose one. Once you have the section title, IniReadSection will pull all of the values listed in that section which you can use to complete your GUI as you wish.Not too difficult to do - try and code something yourself. You know where we are if you run into problems. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
DjDiabolik Posted December 12, 2010 Author Share Posted December 12, 2010 (edited) DjDiabolik,You can get a list of the Section titles using IniReadSectionNames. If you put that list into a combo you can then get the user to choose one. Once you have the section title, IniReadSection will pull all of the values listed in that section which you can use to complete your GUI as you wish.Not too difficult to do - try and code something yourself. You know where we are if you run into problems. M23Ok.. this is for multiselection true ?And for part of script posted up here ? You can help me how i can show the ip readed from .ini file ? Edited December 12, 2010 by DjDiabolik Link to comment Share on other sites More sharing options...
DjDiabolik Posted December 12, 2010 Author Share Posted December 12, 2010 $Input1 = GUICtrlCreateInput($Input1, 8, 72, 113, 21) $Input2 = GUICtrlCreateInput($Input2, 8, 120, 113, 21) $Input3 = GUICtrlCreateInput($Input3, 152, 72, 113, 21) $Input4 = GUICtrlCreateInput($input4, 152, 120, 113, 21) $Input5 = GUICtrlCreateInput($Input5, 8, 24, 113, 21) $Label1 = GUICtrlCreateLabel("DreamBox IP", 32, 8, 66, 17) $Label2 = GUICtrlCreateLabel("UserName", 40, 56, 54, 17) $Label3 = GUICtrlCreateLabel("Password", 40, 104, 50, 17) $Label4 = GUICtrlCreateLabel("HTTP Port (Default:80)", 152, 56, 113, 17) $Label5 = GUICtrlCreateLabel("FTP Port (Default:21)", 152, 104, 104, 17) $Button1 = GUICtrlCreateButton("Salva Configurazione", 72, 160, 113, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 call ("StoreCfg") GUISetState(@SW_HIDE) call ("Menu") EndSwitch WEnd EndFunc ;Storaggio Configurazioni Func StoreCfg() IniWrite (".\config.ini", "CONFIG", "Username", $Input1) IniWrite (".\config.ini", "CONFIG", "Password", $Input2) IniWrite (".\config.ini", "CONFIG", "HttpPort", $Input3) IniWrite (".\config.ini", "CONFIG", "FtpPort", $Input4) IniWrite (".\config.ini", "CONFIG", "Ip", $Input5) EndFunc For example.... for now i chose to use it.... because after this the with Iniwrite i obtain ad error.... Variables not declared.... because ? I have try to add at the start of script the Dim... but after it in the config.ini i not obtain text but all numbers... because ? Link to comment Share on other sites More sharing options...
DjDiabolik Posted December 12, 2010 Author Share Posted December 12, 2010 IniWrite (".\config.ini", "CONFIG", "Username", GUICtrlRead($Input1)) IniWrite (".\config.ini", "CONFIG", "Password", GUICtrlRead($Input2)) IniWrite (".\config.ini", "CONFIG", "HttpPort", GUICtrlRead($Input3)) IniWrite (".\config.ini", "CONFIG", "FtpPort", GUICtrlRead($Input4)) IniWrite (".\config.ini", "CONFIG", "Ip", GUICtrlRead($Input5)) Found solution on help. @Mod... Close this... i decided to open another thread and posted here every difficulty i found to create this my little programs Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now