Jump to content

Security Program (Problem)


Recommended Posts

  • Moderators

Doctorkirk,

A much better format than before, but what happened to the 3 columns? We would need a list of the column headings you require - and this is a serious problem because if you try to enter too many items into a native ListView with not enough columns you get nothing at all. :(

Besides - why are you storing multiple users in this one ini? Surely you would be better using something close to kylomas' format above where each app has its own vales? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

What about if there are many other users? ohh... yes, nothing, i can make a multi-user login and have an ini file for each users, you're right... ok, let's use the kylomas provided one, for the columns thing, we can't modify it after we (or better I) understand how to list 'em? i think that it's the same thing use 3 or 10 columns and then 10 records, right?

Btw, to begin we can use 3 columns, (Url/EXE,Username,Password)

Edit: 3 Columns, got another idea to add other record, let's try to list this 3 record. :)

Edited by Doctorkirk
Link to comment
Share on other sites

  • Moderators

Doctorkirk,

I think I understand all that. :wacko:

Fino a domani. :bye:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Doctorkirk,

Using the ini file that kylomas proposed earlier, this script loads it into a ListView. You can add, delete and modify the entries as you will see by playing with it: ;)

#include <GUIConstantsEx.au3>
#include <GUIListView.au3>

#include <Array.au3>

Global $sIni = "Test.ini"

$hGUI = GUICreate("Test", 500, 500)
GUISetBkColor(0xC4C4C4)

$cListView = GUICtrlCreateListView("App|Username|Password", 10, 10, 480, 300, Default, $LVS_EX_FULLROWSELECT)
_GUICtrlListView_SetColumnWidth($cListView, 0, 155)
_GUICtrlListView_SetColumnWidth($cListView, 1, 155)
_GUICtrlListView_SetColumnWidth($cListView, 2, 155)

_Load_Ini()

GUICtrlCreateLabel("App", 200, 355, 100, 20)
GUICtrlCreateLabel("Username", 200, 395, 100, 20)
GUICtrlCreateLabel("Password", 200, 435, 100, 20)

$cApp = GUICtrlCreateInput("", 200, 370, 200, 20)
$cUser = GUICtrlCreateInput("", 200, 410, 200, 20)
$cPwd = GUICtrlCreateInput("", 200, 450, 200, 20)

$cAdd = GUICtrlCreateButton("Add", 10, 350, 80, 30)
$cDel = GUICtrlCreateButton("Delete", 10, 390, 80, 30)
$cMod = GUICtrlCreateButton("Modify", 10, 430, 80, 30)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $cDel
            ; Read selected item
            $sItemText = GUICtrlRead(GUICtrlRead($cListView))
            ; Split into the different columns
            $aSplit = StringSplit($sItemText, "|")
            ; Delete the ini section
            IniDelete($sIni, $aSplit[1])
            ; Reload the ListView
            _Load_Ini()
        Case $cMod
            ; Read selected item
            $sItemText = GUICtrlRead(GUICtrlRead($cListView))
            ; Split into the different columns
            $aSplit = StringSplit($sItemText, "|")

            ; Place items in inputs
            GUICtrlSetData($cApp, $aSplit[1])
            GUICtrlSetData($cUser, $aSplit[2])
            GUICtrlSetData($cPwd, $aSplit[3])
            ; Change button name
            GUICtrlSetData($cMod, "Save")
            ; Now wait for the "Save" button
            While 1
                Switch GUIGetMsg()
                    Case $cMod
                        ; First delete the existing section
                        IniDelete($sIni, $aSplit[1])
                        ; Rename the button again
                        GUICtrlSetData($cMod, "Modify")
                        ; And now add the new data
                        ; Check we have something to add
                        $sData = GUICtrlRead($cApp) & "|" & GUICtrlRead($cUser) & "|" & GUICtrlRead($cPwd)
                        If $sData <> "||" Then
                            ; Add to the ini
                            IniWrite($sIni, GUICtrlRead($cApp), "name", GUICtrlRead($cUser))
                            IniWrite($sIni, GUICtrlRead($cApp), "pswd", GUICtrlRead($cPwd))
                            ; Rewrite the ListView
                            _Load_Ini()
                            ; Clear the inputs
                            For $i = $cApp To $cPwd
                                GUICtrlSetData($i, "")
                            Next
                        EndIf
                        ; And continue
                        ExitLoop
                EndSwitch
            WEnd
        Case $cAdd
            ; Check we have something to add
            $sData = GUICtrlRead($cApp) & "|" & GUICtrlRead($cUser) & "|" & GUICtrlRead($cPwd)
            If $sData <> "||" Then
                ; Add to the ini
                IniWrite($sIni, GUICtrlRead($cApp), "name", GUICtrlRead($cUser))
                IniWrite($sIni, GUICtrlRead($cApp), "pswd", GUICtrlRead($cPwd))
                ; Rewrite the ListView
                _Load_Ini()
                ; Clear the inputs
                For $i = $cApp To $cPwd
                    GUICtrlSetData($i, "")
                Next
            EndIf
    EndSwitch

WEnd

Func _Load_Ini()
    ; Delete current contents
    _GUICtrlListView_DeleteAllItems($cListView)
    ; Read sections
    $aSections = IniReadSectionNames($sIni)
    ; Loop through sections
    For $i = 1 To $aSections[0]
        ; Add app name to ListView data
        $sData = $aSections[$i]
        ; Now add relevant sections
        $sData &= "|" & IniRead($sIni, $aSections[$i], "name", "Not set")
        $sData &= "|" & IniRead($sIni, $aSections[$i], "pswd", "Not set")
        ; And add data to ListView
        GUICtrlCreateListViewItem($sData, $cListView)
    Next
EndFunc

Now go and study it for a while and then come back later if you have any questions. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

M23, i think i'm gonna love you ahahah i will try to understand every line of this code 2 years to understand how to make it and you in 10 minutes (maybe less) you write the code exactely the way i want... incredible, thanks! :D

Little OT: do you speak italian? :)

Link to comment
Share on other sites

  • Moderators

Doctorkirk,

No - just English (mother tongue), French (I used to be interpreter standard) and some very rusty German. But Google Translate is very useful for all the others. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Ok, i quite fully edited my program i encountered some difficoulties here:

Case $cAdd
$bho = GUICtrlRead($cApp &" ("&$k&")")
$sData = GUICtrlRead($cApp)
$sezioni = IniReadSectionNames($sIni)
For $i = 1 To $sezioni[0]
Next
If $sData = $sezioni[$i] Then
$cMsg = MsgBox(52,"Attenzione!",GUICtrlRead($cApp)&' esiste già, aggiungerlo come"'&GUICtrlRead($cApp)&" ("&$k&')"?')
If $cMsg = 1 Then
IniWrite($sIni,$bho, "name", GUICtrlRead($cUser))
IniWrite($sIni,GUICtrlRead($cApp &" ("&$k&")"), "pswd", GUICtrlRead($cPwd))
_Load_Ini()
MsgBox(0,"",$bho)
$k=$k+01
IniWrite("config","config","k",$k)
Else
GUISetState()
EndIf
Else
;all the thing u write to make the add button make his job

When i insert the same name in the $cApp box (it's an input) and press the add button i retrive this error;

Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

If $sData = $sezioni[$i] Then
If $sData = ^ ERROR

What am i doing wrong?

obviously i'm trying to add the possibility to add many record for the same App/Url... if you know a easiest way (and i think you know it ahah) feel free to give me your own hints. :D

Link to comment
Share on other sites

I am trying to run you script:

#include <GUIConstantsEx.au3>
#include <GUIListView.au3>

#include <Array.au3>

Global $sIni = "Test.ini"

$hGUI = GUICreate("Test", 500, 500)
GUISetBkColor(0xC4C4C4)

$cListView = GUICtrlCreateListView("App|Username|Password", 10, 10, 480, 300, Default, $LVS_EX_FULLROWSELECT)
_GUICtrlListView_SetColumnWidth($cListView, 0, 155)
_GUICtrlListView_SetColumnWidth($cListView, 1, 155)
_GUICtrlListView_SetColumnWidth($cListView, 2, 155)

_Load_Ini()

GUICtrlCreateLabel("App", 200, 355, 100, 20)
GUICtrlCreateLabel("Username", 200, 395, 100, 20)
GUICtrlCreateLabel("Password", 200, 435, 100, 20)

$cApp = GUICtrlCreateInput("", 200, 370, 200, 20)
$cUser = GUICtrlCreateInput("", 200, 410, 200, 20)
$cPwd = GUICtrlCreateInput("", 200, 450, 200, 20)

$cAdd = GUICtrlCreateButton("Add", 10, 350, 80, 30)
$cDel = GUICtrlCreateButton("Delete", 10, 390, 80, 30)
$cMod = GUICtrlCreateButton("Modify", 10, 430, 80, 30)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $cDel
            ; Read selected item
            $sItemText = GUICtrlRead(GUICtrlRead($cListView))
            ; Split into the different columns
            $aSplit = StringSplit($sItemText, "|")
            ; Delete the ini section
            IniDelete($sIni, $aSplit[1])
            ; Reload the ListView
            _Load_Ini()
        Case $cMod
            ; Read selected item
            $sItemText = GUICtrlRead(GUICtrlRead($cListView))
            ; Split into the different columns
            $aSplit = StringSplit($sItemText, "|")

            ; Place items in inputs
            GUICtrlSetData($cApp, $aSplit[1])
            GUICtrlSetData($cUser, $aSplit[2])
            GUICtrlSetData($cPwd, $aSplit[3])
            ; Change button name
            GUICtrlSetData($cMod, "Save")
            ; Now wait for the "Save" button
            While 1
                Switch GUIGetMsg()
                    Case $cMod
                        ; First delete the existing section
                        IniDelete($sIni, $aSplit[1])
                        ; Rename the button again
                        GUICtrlSetData($cMod, "Modify")
                        ; And now add the new data
                        ; Check we have something to add
                        $sData = GUICtrlRead($cApp) & "|" & GUICtrlRead($cUser) & "|" & GUICtrlRead($cPwd)
                        If $sData <> "||" Then
                            ; Add to the ini
                            IniWrite($sIni, GUICtrlRead($cApp), "name", GUICtrlRead($cUser))
                            IniWrite($sIni, GUICtrlRead($cApp), "pswd", GUICtrlRead($cPwd))
                            ; Rewrite the ListView
                            _Load_Ini()
                            ; Clear the inputs
                            For $i = $cApp To $cPwd
                                GUICtrlSetData($i, "")
                            Next
                        EndIf
                        ; And continue
                        ExitLoop
                EndSwitch
            WEnd
        Case $cAdd
            $bho = GUICtrlRead($cApp & " (" & $k & ")")
            $sData = GUICtrlRead($cApp)
            $sezioni = IniReadSectionNames($sIni)
            For $i = 1 To $sezioni[0]
            Next
            If $sData = $sezioni[$i] Then
                $cMsg = MsgBox(52, "Attenzione!", GUICtrlRead($cApp) & ' esiste già, aggiungerlo come"' & GUICtrlRead($cApp) & " (" & $k & ')"?')
                If $cMsg = 1 Then
                    IniWrite($sIni, $bho, "name", GUICtrlRead($cUser))
                    IniWrite($sIni, GUICtrlRead($cApp & " (" & $k & ")"), "pswd", GUICtrlRead($cPwd))
                    _Load_Ini()
                    MsgBox(0, "", $bho)
                    $k = $k + 01
                    IniWrite("config", "config", "k", $k)
                Else
                    GUISetState()
                EndIf
            EndIf

    EndSwitch

WEnd

Func _Load_Ini()
    ; Delete current contents
    _GUICtrlListView_DeleteAllItems($cListView)
    ; Read sections
    $aSections = IniReadSectionNames($sIni)
    ; Loop through sections
    For $i = 1 To $aSections[0]
        ; Add app name to ListView data
        $sData = $aSections[$i]
        ; Now add relevant sections
        $sData &= "|" & IniRead($sIni, $aSections[$i], "name", "Not set")
        $sData &= "|" & IniRead($sIni, $aSections[$i], "pswd", "Not set")
        ; And add data to ListView
        GUICtrlCreateListViewItem($sData, $cListView)
    Next
EndFunc   ;==>_Load_Ini

But as i can see value $k is used before declaration. Please post your complete code so we can help you ;)

Ciao!

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Link to comment
Share on other sites

Here's the code Nessie, but i have to advice you that it's a little bit uspide-down, i added some functionality just today and i have to adjust 'em, and i tried all the day to find the way to add many record with the same app name, i try many combination of code, so if you find any error with the part that i'm trying to fix, never mind, just help me to fix it :P

#include 
#include 
#include 

Global $sIni = "Test.ini", $k = IniRead("config.ini","config","k","Not Set")

$hGUI = GUICreate("Test", 500, 500)
GUISetBkColor(0xC4C4C4)

$cListView = GUICtrlCreateListView("App|Username|Password", 10, 10, 480, 300, Default, $LVS_EX_FULLROWSELECT)
_GUICtrlListView_SetColumnWidth($cListView, 0, 155)
_GUICtrlListView_SetColumnWidth($cListView, 1, 155)
_GUICtrlListView_SetColumnWidth($cListView, 2, 155)

_Load_Ini()
GUICtrlCreateLabel("App", 200, 355, 100, 20)
GUICtrlCreateLabel("Username", 200, 395, 100, 20)
GUICtrlCreateLabel("Password", 200, 435, 100, 20)
GUICtrlCreateLabel("Search",200,315,100,20)

$cSearch = GUICtrlCreateInput("",200,330,200,20)
$cApp = GUICtrlCreateInput("", 200, 370, 200, 20)
$cUser = GUICtrlCreateInput("", 200, 410, 200, 20)
$cPwd = GUICtrlCreateInput("", 200, 450, 200, 20)

$bFetch = GUICtrlCreateButton("Vis.", 10, 310, 80, 30)
$cAdd = GUICtrlCreateButton("Add", 10, 350, 80, 30)
$cDel = GUICtrlCreateButton("Delete", 10, 390, 80, 30)
$cMod = GUICtrlCreateButton("Modify", 10, 430, 80, 30)
$cCan = GUICtrlCreateButton("Cancel", 100,390,50,30)
$cFind = GUICtrlCreateIcon("shell32.dll", -172, 410, 335, 16, 16)
$cFind2 = GUICtrlCreateButton("Find", 100,430,50,30)
$cMore = GUICtrlCreateButton("More...", 100,350,50,30)


GUICtrlSetState($cCan,$GUI_DISABLE)
GUISetState()

While 1

Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit

;~ Come Visualizzare più informazioni
Case $cMore
$Fetch=GUICtrlRead(GUICtrlRead($cListView))
If $Fetch <> "||" Then
$a = GUICreate("test2",200,200)
$1 = GUICtrlCreateInput("",10,10,70,20)
$2 = GUICtrlCreateInput("",10,70,70,20)
$3 = GUICtrlCreateInput("",100,10,70,20)
$4 = GUICtrlCreateInput("",100,70,70,20)
$5 = GUICtrlCreateInput("",150,10,70,20)
$aSplit = StringSplit($Fetch, "|")
GUICtrlSetData($1, $aSplit[1])
GUICtrlSetData($2, $aSplit[2])
GUICtrlSetData($3, $aSplit[3])
GUICtrlSetData($4, IniRead($sIni,$aSplit[1],"question","Not Set"))
GUICtrlSetData($5, IniRead($sIni,$aSplit[1],"answer","Not Set"))
GUISetState()
Else
MsgBox(16,"Errore!!","Selezionare prima la voce!")
EndIf
Case $GUI_EVENT_CLOSE
GUISetState(@SW_HIDE)
;~ Fine dei giochi :D

Case $cDel
; Read selected item
$sItemText = GUICtrlRead(GUICtrlRead($cListView))
; Split into the different columns
$aSplit = StringSplit($sItemText, "|")
; Delete the ini section
IniDelete($sIni, $aSplit[1])
; Reload the ListView
_Load_Ini()

Case $GUI_EVENT_CLOSE
Exit

Case $cFind, $cFind2
find()

Case $cMod
Guictrlsetstate($cCan,$GUI_ENABLE)
; Read selected item
$sItemText = GUICtrlRead(GUICtrlRead($cListView))
; Split into the different columns
$aSplit = StringSplit($sItemText, "|")

; Place items in inputs
GUICtrlSetData($cApp, $aSplit[1])
GUICtrlSetData($cUser, $aSplit[2])
GUICtrlSetData($cPwd, $aSplit[3])
; Change button name
GUICtrlSetData($cMod, "Save")
; Now wait for the "Save" button
While 1
Switch GUIGetMsg()
Case $cCan
GUICtrlSetState($cCan,$GUI_DISABLE)
GUICtrlSetData($cMod, "Modify")
For $i = $cApp To $cPwd
GUICtrlSetData($i, "")
Next
ExitLoop
Case $cMod
GUICtrlSetState($cCan,$GUI_DISABLE)
; First delete the existing section
IniDelete($sIni, $aSplit[1])
; Rename the button again
GUICtrlSetData($cMod, "Modify")
; And now add the new data
; Check we have something to add
$sData = GUICtrlRead($cApp) & "|" & GUICtrlRead($cUser) & "|" & GUICtrlRead($cPwd)
If $sData <> "||" Then
; Add to the ini
IniWrite($sIni, GUICtrlRead($cApp), "name", GUICtrlRead($cUser))
IniWrite($sIni, GUICtrlRead($cApp), "pswd", GUICtrlRead($cPwd))
; Rewrite the ListView
_Load_Ini()
; Clear the inputs
For $i = $cApp To $cPwd
GUICtrlSetData($i, "")
Next
EndIf
; And continue
ExitLoop
EndSwitch
WEnd
Case $cAdd
$bho = GUICtrlRead($cApp &" ("&$k&")")
$sData = GUICtrlRead($cApp)
$aSections = IniReadSectionNames($sIni)
For $i = 1 To $aSections[0]
Next
If $sData = $aSections[$i] Then
$cMsg = MsgBox(52,"Attenzione!",GUICtrlRead($cApp)&' esiste già, aggiungerlo come"'&GUICtrlRead($cApp)&" ("&$k&')"?')
If $cMsg = 1 Then
IniWrite($sIni,$bho, "name", GUICtrlRead($cUser))
IniWrite($sIni,GUICtrlRead($cApp &" ("&$k&")"), "pswd", GUICtrlRead($cPwd))
_Load_Ini()
MsgBox(0,"",$bho)
$k=$k+01
IniWrite("config","config","k",$k)
Else
GUISetState()
EndIf
Else
$sData = GUICtrlRead($cApp) & "|" & GUICtrlRead($cUser) & "|" & GUICtrlRead($cPwd)
If $sData <> "||" Then
; Add to the ini
IniWrite($sIni, GUICtrlRead($cApp), "name", GUICtrlRead($cUser))
IniWrite($sIni, GUICtrlRead($cApp), "pswd", GUICtrlRead($cPwd))
; Rewrite the ListView
_Load_Ini()
; Clear the inputs
For $i = $cApp To $cPwd
GUICtrlSetData($i, "")
Next
EndIf
EndIf
EndSwitch

WEnd

Func _Load_Ini()
; Delete current contents
_GUICtrlListView_DeleteAllItems($cListView)
; Read sections
$aSections = IniReadSectionNames($sIni)
; Loop through sections
For $i = 1 To $aSections[0]
; Add app name to ListView data
$sData = $aSections[$i]
; Now add relevant sections
$sData &= "|" & IniRead($sIni, $aSections[$i], "name", "Not set")
$sData &= "|" & IniRead($sIni, $aSections[$i], "pswd", "Not set")
; And add data to ListView
GUICtrlCreateListViewItem($sData, $cListView)
Next
EndFunc

Func find()
$fText = _GUICtrlListView_FindText($cListView,GUICtrlRead($cSearch))
_GUICtrlListView_SetItemSelected($cListView, $fText, True, True)
_GUICtrlListView_ClickItem($cListView, $fText)
EndFunc
Link to comment
Share on other sites

First of all you will have this error:

Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

If $sData = $sezioni[$i] Then
If $sData = ^ ERROR

Because you are trying to read this array OUTSIDE the For/Next Loop

Infact i see that:

For $i = 1 To $aSections[0]
Next
If $sData = $aSections[$i] Then

Just put your code INSIDE the For/Next Loop

For $i = 1 To $aSections[0]
                If $sData = $aSections[$i] Then
                    $cMsg = MsgBox(52, "Attenzione!", GUICtrlRead($cApp) & ' esiste già, aggiungerlo come"' & GUICtrlRead($cApp) & " (" & $k & ')"?')
                    If $cMsg = 1 Then
                        IniWrite($sIni, $bho, "name", GUICtrlRead($cUser))
                        IniWrite($sIni, GUICtrlRead($cApp & " (" & $k & ")"), "pswd", GUICtrlRead($cPwd))
                        _Load_Ini()
                        MsgBox(0, "", $bho)
                        $k = $k + 01
                        IniWrite("config", "config", "k", $k)
                    Else
                        GUISetState()
                    EndIf
                Else
                    $sData = GUICtrlRead($cApp) & "|" & GUICtrlRead($cUser) & "|" & GUICtrlRead($cPwd)
                    If $sData <> "||" Then
                        ; Add to the ini
                        IniWrite($sIni, GUICtrlRead($cApp), "name", GUICtrlRead($cUser))
                        IniWrite($sIni, GUICtrlRead($cApp), "pswd", GUICtrlRead($cPwd))
                        ; Rewrite the ListView
                        _Load_Ini()
                        ; Clear the inputs
                        For $i = $cApp To $cPwd
                            GUICtrlSetData($i, "")
                        Next
                    EndIf
                EndIf
            Next

EDIT:

Here is another problem, if you press Modify without selecting an listview element your script will crash. Just add this code to avoid this issue:

Case $cMod
            ; Read selected item
            $sItemText = GUICtrlRead(GUICtrlRead($cListView))
            ;Add so if there is nothing selected in the listview the program will just ignore it, and will not give you some error ;)
            If Not StringInStr($sItemText, "|") Then ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                ContinueLoop
            EndIf
            ; Split into the different columns
            $aSplit = StringSplit($sItemText, "|")

            ; Place items in inputs
            GUICtrlSetData($cApp, $aSplit[1])
            GUICtrlSetData($cUser, $aSplit[2])
            GUICtrlSetData($cPwd, $aSplit[3])
            
            GUICtrlSetState($cCan, $GUI_ENABLE)

Hi!

Ciao, fammi sapere se hai problemi :P

Edited by Nessie

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Link to comment
Share on other sites

Ok, now i (obviously) got no error yet, but there still a problem, the program can't read that the "App" record already exist as one of the section... can't understand why, today, "playing" with it a little i've found a combination semi-right, it was comparing the name, giving me the msgbox in returns, the problem was that i wasn't be able to write the ini .-. could you help me in some way? :D

EDIT: Forgot that i'm on an English forum, rewritten the question in English language, forgive me.

Edited by Doctorkirk
Link to comment
Share on other sites

Here is the code now, with this the programm will understand if you are appname that you are trying to add already exist.

Italian translation:

Ora il programma dovrebbe capire quando stai cercando di aggiungere un App che ha lo stesso nome di una delle sezioni del file ini. Ora se ho capito bene vuoi cercare un metodo per inserire due App con lo stesso nome?

P.S. Scrivi sempre l'equivalente inglese di quello che vuoi dire altrimenti potresti beccarti qualche richiamo ;)

#include <GUIConstantsEx.au3>
#include <GUIListView.au3>
#include <Array.au3>

Global $sIni = "Test.ini", $k = IniRead("config.ini", "config", "k", "Not Set")

$hGUI = GUICreate("Test", 500, 500)
GUISetBkColor(0xC4C4C4)

$cListView = GUICtrlCreateListView("App|Username|Password", 10, 10, 480, 300, Default, $LVS_EX_FULLROWSELECT)
_GUICtrlListView_SetColumnWidth($cListView, 0, 155)
_GUICtrlListView_SetColumnWidth($cListView, 1, 155)
_GUICtrlListView_SetColumnWidth($cListView, 2, 155)

_Load_Ini()
GUICtrlCreateLabel("App", 200, 355, 100, 20)
GUICtrlCreateLabel("Username", 200, 395, 100, 20)
GUICtrlCreateLabel("Password", 200, 435, 100, 20)
GUICtrlCreateLabel("Search", 200, 315, 100, 20)

$cSearch = GUICtrlCreateInput("", 200, 330, 200, 20)
$cApp = GUICtrlCreateInput("", 200, 370, 200, 20)
$cUser = GUICtrlCreateInput("", 200, 410, 200, 20)
$cPwd = GUICtrlCreateInput("", 200, 450, 200, 20)

$bFetch = GUICtrlCreateButton("Vis.", 10, 310, 80, 30)
$cAdd = GUICtrlCreateButton("Add", 10, 350, 80, 30)
$cDel = GUICtrlCreateButton("Delete", 10, 390, 80, 30)
$cMod = GUICtrlCreateButton("Modify", 10, 430, 80, 30)
$cCan = GUICtrlCreateButton("Cancel", 100, 390, 50, 30)
$cFind = GUICtrlCreateIcon("shell32.dll", -172, 410, 335, 16, 16)
$cFind2 = GUICtrlCreateButton("Find", 100, 430, 50, 30)
$cMore = GUICtrlCreateButton("More...", 100, 350, 50, 30)


GUICtrlSetState($cCan, $GUI_DISABLE)
GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit

;~ Come Visualizzare più informazioni
        Case $cMore
            $Fetch = GUICtrlRead(GUICtrlRead($cListView))
            If $Fetch <> "||" Then
                $a = GUICreate("test2", 200, 200)
                $1 = GUICtrlCreateInput("", 10, 10, 70, 20)
                $2 = GUICtrlCreateInput("", 10, 70, 70, 20)
                $3 = GUICtrlCreateInput("", 100, 10, 70, 20)
                $4 = GUICtrlCreateInput("", 100, 70, 70, 20)
                $5 = GUICtrlCreateInput("", 150, 10, 70, 20)
                $aSplit = StringSplit($Fetch, "|")
                GUICtrlSetData($1, $aSplit[1])
                GUICtrlSetData($2, $aSplit[2])
                GUICtrlSetData($3, $aSplit[3])
                GUICtrlSetData($4, IniRead($sIni, $aSplit[1], "question", "Not Set"))
                GUICtrlSetData($5, IniRead($sIni, $aSplit[1], "answer", "Not Set"))
                GUISetState()
            Else
                MsgBox(16, "Errore!!", "Selezionare prima la voce!")
            EndIf
        Case $GUI_EVENT_CLOSE
            GUISetState(@SW_HIDE)
;~ Fine dei giochi :D

        Case $cDel
            ; Read selected item
            $sItemText = GUICtrlRead(GUICtrlRead($cListView))
            ; Split into the different columns
            $aSplit = StringSplit($sItemText, "|")
            ; Delete the ini section
            IniDelete($sIni, $aSplit[1])
            ; Reload the ListView
            _Load_Ini()

        Case $GUI_EVENT_CLOSE
            Exit

        Case $cFind, $cFind2
            find()

        Case $cMod
            ; Read selected item
            $sItemText = GUICtrlRead(GUICtrlRead($cListView))
            ;Add so if there is nothing selected in the listview the program will just ignore it, and will not give you some error ;)
            If Not StringInStr($sItemText, "|") Then ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                ContinueLoop
            EndIf
            ; Split into the different columns
            $aSplit = StringSplit($sItemText, "|")

            ; Place items in inputs
            GUICtrlSetData($cApp, $aSplit[1])
            GUICtrlSetData($cUser, $aSplit[2])
            GUICtrlSetData($cPwd, $aSplit[3])

            GUICtrlSetState($cCan, $GUI_ENABLE)


            ; Change button name
            GUICtrlSetData($cMod, "Save")
            ; Now wait for the "Save" button
            While 1
                Switch GUIGetMsg()
                    Case $cCan
                        GUICtrlSetState($cCan, $GUI_DISABLE)
                        GUICtrlSetData($cMod, "Modify")
                        For $i = $cApp To $cPwd
                            GUICtrlSetData($i, "")
                        Next
                        ExitLoop
                    Case $cMod
                        GUICtrlSetState($cCan, $GUI_DISABLE)
                        ; First delete the existing section
                        IniDelete($sIni, $aSplit[1])
                        ; Rename the button again
                        GUICtrlSetData($cMod, "Modify")
                        ; And now add the new data
                        ; Check we have something to add
                        $sData = GUICtrlRead($cApp) & "|" & GUICtrlRead($cUser) & "|" & GUICtrlRead($cPwd)
                        If $sData <> "||" Then
                            ; Add to the ini
                            IniWrite($sIni, GUICtrlRead($cApp), "name", GUICtrlRead($cUser))
                            IniWrite($sIni, GUICtrlRead($cApp), "pswd", GUICtrlRead($cPwd))
                            ; Rewrite the ListView
                            _Load_Ini()
                            ; Clear the inputs
                            For $i = $cApp To $cPwd
                                GUICtrlSetData($i, "")
                            Next
                        EndIf
                        ; And continue
                        ExitLoop
                EndSwitch
            WEnd
        Case $cAdd
            MsgBox(0,"","")
            $bho = GUICtrlRead($cApp & " (" & $k & ")")
            $sData = GUICtrlRead($cApp)
            $aSections = IniReadSectionNames($sIni)
            For $i = 1 To $aSections[0]
                If $sData = $aSections[$i] Then
                    $cMsg = MsgBox(52, "Attenzione!", GUICtrlRead($cApp) & ' esiste già, aggiungerlo come"' & GUICtrlRead($cApp) & " (" & $k & ')"?')
                    If $cMsg = 1 Then
                        IniWrite($sIni, $bho, "name", GUICtrlRead($cUser))
                        IniWrite($sIni, GUICtrlRead($cApp & " (" & $k & ")"), "pswd", GUICtrlRead($cPwd))
                        _Load_Ini()
                        MsgBox(0, "", $bho)
                        $k = $k + 01
                        IniWrite("config", "config", "k", $k)
                    Else
                        GUISetState()
                    EndIf
                Else
                    $sData = GUICtrlRead($cApp) & "|" & GUICtrlRead($cUser) & "|" & GUICtrlRead($cPwd)
                    If $sData <> "||" Then
                        ; Add to the ini
                        IniWrite($sIni, GUICtrlRead($cApp), "name", GUICtrlRead($cUser))
                        IniWrite($sIni, GUICtrlRead($cApp), "pswd", GUICtrlRead($cPwd))
                        ; Rewrite the ListView
                        _Load_Ini()
                        ; Clear the inputs
                        For $i = $cApp To $cPwd
                            GUICtrlSetData($i, "")
                        Next
                    EndIf
                EndIf
            Next

    EndSwitch

WEnd

Func _Load_Ini()
    ; Delete current contents
    _GUICtrlListView_DeleteAllItems($cListView)
    ; Read sections
    $aSections = IniReadSectionNames($sIni)
    ; Loop through sections
    For $i = 1 To $aSections[0]
        ; Add app name to ListView data
        $sData = $aSections[$i]
        ; Now add relevant sections
        $sData &= "|" & IniRead($sIni, $aSections[$i], "name", "Not set")
        $sData &= "|" & IniRead($sIni, $aSections[$i], "pswd", "Not set")
        ; And add data to ListView
        GUICtrlCreateListViewItem($sData, $cListView)
    Next
EndFunc   ;==>_Load_Ini

Func find()
    $fText = _GUICtrlListView_FindText($cListView, GUICtrlRead($cSearch))
    _GUICtrlListView_SetItemSelected($cListView, $fText, True, True)
    _GUICtrlListView_ClickItem($cListView, $fText)
EndFunc   ;==>find

Hi!

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Link to comment
Share on other sites

P.S. Scrivi sempre l'equivalente inglese di quello che vuoi dire altrimenti potresti beccarti qualche richiamo ;)

Ho Appena riscritto il tutto in inglese motivando l'edit, almeno son contenti, thanks for the advice! ;)

Ora se ho capito bene vuoi cercare un metodo per inserire due App con lo stesso nome?

Exactly, let's think about a person that have two Facebook/Twitter/Bank Account, we fetch the data from the App name, so we have to make a program confomtable for any kinda users, making possible the addiction of more "same-named" App account, to make this possible i think you've understood it reading the code :)

Here is the code now, with this the programm will understand if appname that you are trying to add already exist.

Ehm... it does not work, it add the record just rewriting the already-existing one... it skips the "If $sData = $aSections[$i] Then" part... :mad:

P.S. Vado a dormire ora, che sono le 3:10, a domani, e grazie ancora per l'aiuto! :D

English: Now i'll go to sleep, since it's 3:10 a.m., thanks again for helping me! :D

Edited by Doctorkirk
Link to comment
Share on other sites

Now it should work, see the ;<<<< to know what i have changed in the code. About the thing of adding two or more app with the same name, i will thinking for an easy solution tomorrow, now it's a little bit late :P. By the way you can also use a simple SQLite database to do what you want to do ;)

Italian translation:

Ora dovrebbe andare ci mancava un ExitLoop e il programma sovrascriveva sempre anche quando non doveva. Guarda i commenti che iniziano con ;<<<< per vedere dove ho modificato il codice. Riguardo il fatto dell'inserire altri 2 o più app con lo stesso nome bisogna ragionarsi un attimino sopra, ora è un pò tardi magari domani ci dò un occhiata ;) Ad ogni modo questo sarebbe un lavoro ideale per un database SQLite, che è molto più veloce ed adatto allo scopo rispetto ad un file ini.

#include <GUIConstantsEx.au3>
#include <GUIListView.au3>
#include <Array.au3>

Global $sIni = "Test.ini", $k = IniRead("config.ini", "config", "k", "Not Set")

$hGUI = GUICreate("Test", 500, 500)
GUISetBkColor(0xC4C4C4)

$cListView = GUICtrlCreateListView("App|Username|Password", 10, 10, 480, 300, Default, $LVS_EX_FULLROWSELECT)
_GUICtrlListView_SetColumnWidth($cListView, 0, 155)
_GUICtrlListView_SetColumnWidth($cListView, 1, 155)
_GUICtrlListView_SetColumnWidth($cListView, 2, 155)

_Load_Ini()
GUICtrlCreateLabel("App", 200, 355, 100, 20)
GUICtrlCreateLabel("Username", 200, 395, 100, 20)
GUICtrlCreateLabel("Password", 200, 435, 100, 20)
GUICtrlCreateLabel("Search", 200, 315, 100, 20)

$cSearch = GUICtrlCreateInput("", 200, 330, 200, 20)
$cApp = GUICtrlCreateInput("", 200, 370, 200, 20)
$cUser = GUICtrlCreateInput("", 200, 410, 200, 20)
$cPwd = GUICtrlCreateInput("", 200, 450, 200, 20)

$bFetch = GUICtrlCreateButton("Vis.", 10, 310, 80, 30)
$cAdd = GUICtrlCreateButton("Add", 10, 350, 80, 30)
$cDel = GUICtrlCreateButton("Delete", 10, 390, 80, 30)
$cMod = GUICtrlCreateButton("Modify", 10, 430, 80, 30)
$cCan = GUICtrlCreateButton("Cancel", 100, 390, 50, 30)
$cFind = GUICtrlCreateIcon("shell32.dll", -172, 410, 335, 16, 16)
$cFind2 = GUICtrlCreateButton("Find", 100, 430, 50, 30)
$cMore = GUICtrlCreateButton("More...", 100, 350, 50, 30)


GUICtrlSetState($cCan, $GUI_DISABLE)
GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit

;~ Come Visualizzare più informazioni
        Case $cMore
            $Fetch = GUICtrlRead(GUICtrlRead($cListView))
            If $Fetch <> "||" Then
                $a = GUICreate("test2", 200, 200)
                $1 = GUICtrlCreateInput("", 10, 10, 70, 20)
                $2 = GUICtrlCreateInput("", 10, 70, 70, 20)
                $3 = GUICtrlCreateInput("", 100, 10, 70, 20)
                $4 = GUICtrlCreateInput("", 100, 70, 70, 20)
                $5 = GUICtrlCreateInput("", 150, 10, 70, 20)
                $aSplit = StringSplit($Fetch, "|")
                GUICtrlSetData($1, $aSplit[1])
                GUICtrlSetData($2, $aSplit[2])
                GUICtrlSetData($3, $aSplit[3])
                GUICtrlSetData($4, IniRead($sIni, $aSplit[1], "question", "Not Set"))
                GUICtrlSetData($5, IniRead($sIni, $aSplit[1], "answer", "Not Set"))
                GUISetState()
            Else
                MsgBox(16, "Errore!!", "Selezionare prima la voce!")
            EndIf
        Case $GUI_EVENT_CLOSE
            GUISetState(@SW_HIDE)
;~ Fine dei giochi :D

        Case $cDel
            ; Read selected item
            $sItemText = GUICtrlRead(GUICtrlRead($cListView))
            ; Split into the different columns
            $aSplit = StringSplit($sItemText, "|")
            ; Delete the ini section
            IniDelete($sIni, $aSplit[1])
            ; Reload the ListView
            _Load_Ini()

        Case $GUI_EVENT_CLOSE
            Exit

        Case $cFind, $cFind2
            find()

        Case $cMod
            ; Read selected item
            $sItemText = GUICtrlRead(GUICtrlRead($cListView))
            ;Add so if there is nothing selected in the listview the program will just ignore it, and will not give you some error ;)
            If Not StringInStr($sItemText, "|") Then ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                ContinueLoop
            EndIf
            ; Split into the different columns
            $aSplit = StringSplit($sItemText, "|")

            ; Place items in inputs
            GUICtrlSetData($cApp, $aSplit[1])
            GUICtrlSetData($cUser, $aSplit[2])
            GUICtrlSetData($cPwd, $aSplit[3])

            GUICtrlSetState($cCan, $GUI_ENABLE)


            ; Change button name
            GUICtrlSetData($cMod, "Save")
            ; Now wait for the "Save" button
            While 1
                Switch GUIGetMsg()
                    Case $cCan
                        GUICtrlSetState($cCan, $GUI_DISABLE)
                        GUICtrlSetData($cMod, "Modify")
                        For $i = $cApp To $cPwd
                            GUICtrlSetData($i, "")
                        Next
                        ExitLoop
                    Case $cMod
                        GUICtrlSetState($cCan, $GUI_DISABLE)
                        ; First delete the existing section
                        IniDelete($sIni, $aSplit[1])
                        ; Rename the button again
                        GUICtrlSetData($cMod, "Modify")
                        ; And now add the new data
                        ; Check we have something to add
                        $sData = GUICtrlRead($cApp) & "|" & GUICtrlRead($cUser) & "|" & GUICtrlRead($cPwd)
                        If $sData <> "||" Then
                            ; Add to the ini
                            IniWrite($sIni, GUICtrlRead($cApp), "name", GUICtrlRead($cUser))
                            IniWrite($sIni, GUICtrlRead($cApp), "pswd", GUICtrlRead($cPwd))
                            ; Rewrite the ListView
                            _Load_Ini()
                            ; Clear the inputs
                            For $i = $cApp To $cPwd
                                GUICtrlSetData($i, "")
                            Next
                        EndIf
                        ; And continue
                        ExitLoop
                EndSwitch
            WEnd
        Case $cAdd
            $bho = GUICtrlRead($cApp & " (" & $k & ")")
            $sData = GUICtrlRead($cApp)
            $aSections = IniReadSectionNames($sIni)
            For $i = 1 To $aSections[0]
                If $sData = $aSections[$i] Then
                    $cMsg = MsgBox(52, "Attenzione!", GUICtrlRead($cApp) & ' esiste già, aggiungerlo come"' & GUICtrlRead($cApp) & " (" & $k & ')"?')
                    If $cMsg = 1 Then
                        IniWrite($sIni, $bho, "name", GUICtrlRead($cUser))
                        IniWrite($sIni, GUICtrlRead($cApp & " (" & $k & ")"), "pswd", GUICtrlRead($cPwd))
                        _Load_Ini()
                        MsgBox(0, "", $bho)
                        $k = $k + 01
                        IniWrite("config", "config", "k", $k)
                        ExitLoop ;<<<<<<<<<<<<<< All done here we can skip the loop
                    Else
                        GUISetState()
                        ExitLoop ;<<<<<<<<<<<<<<< Here is the problem!
                    EndIf
                Else
                    $sData = GUICtrlRead($cApp) & "|" & GUICtrlRead($cUser) & "|" & GUICtrlRead($cPwd)
                    If $sData <> "||" Then
                        ; Add to the ini
                        IniWrite($sIni, GUICtrlRead($cApp), "name", GUICtrlRead($cUser))
                        IniWrite($sIni, GUICtrlRead($cApp), "pswd", GUICtrlRead($cPwd))
                        ; Rewrite the ListView
                        _Load_Ini()
                        ; Clear the inputs
                        For $i = $cApp To $cPwd
                            GUICtrlSetData($i, "")
                        Next
                    EndIf
                EndIf
            Next

    EndSwitch

WEnd

Func _Load_Ini()
    ; Delete current contents
    _GUICtrlListView_DeleteAllItems($cListView)
    ; Read sections
    $aSections = IniReadSectionNames($sIni)
    ; Loop through sections
    For $i = 1 To $aSections[0]
        ; Add app name to ListView data
        $sData = $aSections[$i]
        ; Now add relevant sections
        $sData &= "|" & IniRead($sIni, $aSections[$i], "name", "Not set")
        $sData &= "|" & IniRead($sIni, $aSections[$i], "pswd", "Not set")
        ; And add data to ListView
        GUICtrlCreateListViewItem($sData, $cListView)
    Next
EndFunc   ;==>_Load_Ini

Func find()
    $fText = _GUICtrlListView_FindText($cListView, GUICtrlRead($cSearch))
    _GUICtrlListView_SetItemSelected($cListView, $fText, True, True)
    _GUICtrlListView_ClickItem($cListView, $fText)
EndFunc   ;==>find

Ciao!

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Link to comment
Share on other sites

I Never "played" with SQLite, so i don't even know how to start with it... ahaha

Btw, it does not work again, same problem as above... it rewrite the already-existing record... it not even show me the MsgBox, i'm going to think that the problem is reading what's write on the $cApp and comparing it with all the records (searching if ther's something like the provided one) :S

Link to comment
Share on other sites

  • Moderators

Doctorkirk,

Using an ini file you can only ever have one set of data for a given record - the "App" name is stored in the ini section header and you cannot have multiple section headers with the same name. :(

However, we could look at creating section headers with a numeric suffix (My Bank_001, My_Bank_002, etc) - or just put the App name as a key=value pair within the section and use simple numeric section names:

[001]
title= My Bank
name=www.some.url
pswd=my password
sec1=security question1
ans1=security question 1 answer
[002]
title=PC1
name=admin
pswd=admin password
[003]
title=User1
name=user1
pswd=user2 password
[004]
title=autoit
name=my user id
pswd=my password

Do either of those seem like a good way forward? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

we could look at creating section headers with a numeric suffix (My Bank_001, My_Bank_002, etc)

Right the thing i was trying to do, adding the suffix (01) if already exist a section named like the input value, but it doesn't compare the input and the section names

use simple numeric section names

Just the idea that you and kylomas rejected, saying it was not good for this purpose... .-.

EDIT: Sorry, i never share this idea here (the last one), forget it! ahahah

Edited by Doctorkirk
Link to comment
Share on other sites

  • Moderators

Doctorkirk,

We rejected your initial attempt at an ini:

[a]
1=a
2=b
[p]
1=c
2=d

as it was not at all clear what any of the section names or key=value pairs represented - what I have suggested above is a very different thing. ;)

So which version would you prefer to adopt? My preference would be for the ini along the lines of the one I posted - more flexible and easier to parse. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

We rejected your initial attempt at an ini:

Yeah, yeah i know i think about to share it with you but i don't ahaha

My preference would be for the ini along the lines of the one I posted

If you prefer the [001] ones, yeah, let's use it, you gave me right reasons to use it (and overall to follow your advice :P).

Btw, What's wrong with my code? i can't find the way to even find if a record already exist... :/

Edited by Doctorkirk
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...