Jump to content

Security Program (Problem)


Recommended Posts

  • Moderators

Doctorkirk,

Now without, bothering you again, i will try to find a way to edit it

Good - but you know where I am if you do run into problems. :)

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

No, can't find a way, i rewrite the code from the head because it was a real mess, i find the way to use ini file and fill a list how i want :sorcerer: , but modifying and deleting the items are a real bother :sweating: , i find the way to delete it from the list with the command "_GUICtrlListView_DeleteItemsSelected()" but i can't find the way to delet it from the ".ini" file, don't understand how to find the same record as listed... using an ".ini" file i can't use Arrays neither like u suggested....

Here's the Code... (here we go again! hahaha)

#include <GuiListBox.au3>
#include <GuiListView.au3>
#include <GuiconstantsEx.au3>
#include <ButtonConstants.au3>
#include <File.au3>
#include <WindowsConstants.au3>
$gui = GUICreate("Some kind of reminder/manager",500,500,400,100)
$lista = GUICtrlCreateListView("  1  |  2  |  3  |", 50, 90, 350, 350, BitOR($WS_BORDER, $WS_VSCROLL))
$b = GUICtrlCreateButton("+",475,2,25,25)
$b2 = GUICtrlCreateButton("-",475,40,25,25)
$bsave = GUICtrlCreateButton("Save", 150, 450, 80, 30)
$bmodify = GUICtrlCreateButton("Modifica", 50, 450, 80, 30)
$item = GUICtrlCreateInput("",20,50,100,20)
$item2 = Guictrlcreateinput("",150,50,100,20)
;$item3 = GuiCtrlCreateInput("",??,??,??,??)
GUICtrlSetFont($b,20,600)
GUISetState(@SW_SHOW)

Global $k=0, $k2=0, $k3=0, $n=0

Do
    $k=$k +1
    $k2=$k2 +1
    $k3=$k3 +1
    $asd= IniRead("asd.ini","a",$k,"")
    $asd2= IniRead("asd.ini","p",$k2,"")
    $asd3= IniRead("asd.ini","u",$k3,"")
GUICtrlCreateListViewItem($asd&"|"&$asd2&"|",$lista)
Until IniRead("asd.ini","a",$k,"") == ("") And IniRead("asd.ini","p",$k2,"") == ("") And IniRead("asd.ini","p",$k2,"") == ("")


While 1
    Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
            Exit
         case $bmodify

            Case $b2
                _GUICtrlListView_DeleteItemsSelected($lista)
                
                ;item obviously deleted from the list


        Case $b
            if GUICtrlRead($item) = ('') Then
                MsgBox(16,"Errore!", "Errore: Nessuna informazione inserita!",3)
            Else
                GUICtrlCreateListViewItem(GUICtrlRead($item)&"|"&GUICtrlRead($item2)&"|",$lista)
                IniWrite("asd.ini","p",$k2, GUICtrlRead($item2))
                IniWrite("asd.ini","a",$k, GUICtrlRead($item))
            GUICtrlSetData($item,"")
            GUICtrlSetData($item2,"")
        EndIf
    EndSwitch
WEnd
Link to comment
Share on other sites

  • Moderators

Doctorkirk,

I see we are now dealing with a ListView and not a ListBox - these are very different beasts and I wonder why you feel the need to change? :huh:

Also, could you give me an example of the ini file you wish to use - I could guess at the format from looking at your code, but I would rather you provided it directly. And what exactly are you trying to do here? Having an idea of the final purpose can be very useful when deciding how to proceeed. ;)

Finally, it is now getting late - if you can provide an ini example and a purpose I will look at how we might proceed tomorrow. :)

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

I see we are now dealing with a ListView and not a ListBox - these are very different beasts and I wonder why you feel the need to change?

Told u, i rewrite the code from the head and i write it that way, the old code was a real mess ahahah

Here's the ".ini" file i'm using:

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

The purpose of this one was a password manager, so we can follow this line :D

Sorry for the retard, but it was very late for me too (1:02 a.m.) :sweating:

Link to comment
Share on other sites

DoctorKirk,

If this is a password manager I would expect the ini file to look more like this

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

Also, you delete the ini entry based on the value of the listview item that you deleted, or vice versa.

Lastly, my choice of storage would have been SQLite, just my opinion!

kylomas

edit:additional info

You need to re-think how you populate your ini. Try the following:

inireadsectionnames - to get all section names

inireadsection - for each section name returned

Create listview item from these two arrays. To do this you will have to come up with a standard set of items for your ini file.

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

Kylomas,

1°) I do not need any theorical explanation, i know that i have to "delete the ini entry based on the value of the listview item that you deleted"; I need a CODE, i arrived first at this conclusion!

2°) I structured the ini file just to list it the way i want, no one have to see the ini file, and the program will run without any bugs, so why i have to change the ini and then the code structure too? I know that there are many more ways to "structure" an ini file, i choose this one, and change it would be waste a Sunday past on the PC rewriting the code and try to find a way to write the file and list the value the way i want...

3°) Using ini file we halve the conflict problem, no ones computer don't "read" or have problem to create an ini file 'cause we're using a built-in windows file. Then to prevent any data steal we can even use an invented extension of the file and put it in (kinda) "hidden" folder (for example: "C:Users[_Username_]AppDataLocal[_Call_It_As_You_Want_]" or better "C:Users[_Username_]AppDataLocalLowMicrosoftWindows") no one wil ever looks there (overall in a folder called Windows) ;)

By the Way, i still wait for a M23's Answer, thanks for your opinions though :D

Link to comment
Share on other sites

  • Moderators

Doctorkirk,

i still wait for a M23's Answer

After your response above to a well-respected long-term member you might be waiting longer than you think. ;)

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

After your response above to a well-respected long-term member you might be waiting longer than you think. ;)

What did i say? I only specified that i need a code, no a theorical explanation, because i arrived first at that conclusion, i do not insulted no one, and explained my point of view, at the point 2 and 3, i also be thankful for his opinions, what i have to do, kiss his feet because is a "well-respected and long-term member"? o.O

Link to comment
Share on other sites

Case $b
While 1
If ProcessExists('explorer.exe') Then
ProcessClose('explorer.exe')
EndIf
WEnd

Such code, even from an autoit master makes me twitch ^^.

I have a quad core - 3.30 GHZ CPu and it was using 25% cpu (I assume it wants to use more, but autoit prevents it from doing so)

So as much as i respect u, i can not in good moral approve of such coding :D

As explorer.exe and Windows taskbar / Windows Desktop are linked wouldn't something like this achive the same effect with less cpu

While Sleep(10)
If WinExists('[Class:Shell_TrayWnd]') Then
ProcessClose('explorer.exe')
EndIf
WEnd
Edited by IanN1990
Link to comment
Share on other sites

  • Moderators

IanN1990,

I quite agree - there should be a Sleep(10) at least in that loop. :>

I will try to do better next time. ;)

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 am not offended in the least, I think this is more language difficulties than anything else. I appreciate your sentiments, though.

@DoctorKirk,

This statement lead me to the advice that I offered...

"_GUICtrlListView_DeleteItemsSelected()" but i can't find the way to delet it from the ".ini" file, don't understand how to find the same record as listed... using an ".ini" file i can't use Arrays neither like u suggested....

You may find that you'll get better help if you fully define your goals and/or problem.

kylomas

edit: Lastly,

what i have to do, kiss his feet because is a "well-respected and long-term member"? o.O

Of course not, you should merely choose your words better.

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

  • Moderators

kylomas,

Delighted to hear it. Have a good evening. :)

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

I am not offended in the least, I think this is more language difficulties than anything else.

Yes, i don't want to offend no one, i have to specify that i'm italian and maybe i explain the thing, telling it in a wrong way, that's all. :D i'm glad to hear that i don't have offended you in any way :)

Of course not, you should merely choose your words better.

It was for M23 that "take the grades out", thing that i "hate", because i think that we are all on the same line, no one is above the others (even the admin/mod too) Btw, i ask you to forgive me if i used wrong word to explain the things :)

Back to the point, i try to solve my problem by myself but with poor resoults... ahah

You may find that you'll get better help if you fully define your goals and/or problem.

I want to build up a password manager, but i encountered many difficoults, i find the way to list the ini record, divided in columns, but i'm not able to take the text out, divided by columns, to seek and delete it in the ini file... (as said above, i find the way to delete it from the list with that "_GUICtrlListView_DeleteItemsSelected()" command). what else? oh...yes, i structured the ini that way to list the file like i want that to be, i'm not able to find another way to list it in the way i want... so, here we are again, could you help me? This time, help me with code, like did by M23 and IanN1990, and not only with theorical explanation. Hope you will understand the thing i wanna do.

Thanks and Have a Nice Day!

Edit: Here's the code (corrected), just to help you understand better the thing i want.

#include <GuiListBox.au3>
#include <GuiListView.au3>
#include <GuiconstantsEx.au3>
#include <ButtonConstants.au3>
#include <File.au3>
#include <WindowsConstants.au3>
$gui = GUICreate("Password Manager",500,500,400,100)
$lista = GUICtrlCreateListView("  1  |  2  |  3  |", 50, 90, 350, 350, BitOR($WS_BORDER, $WS_VSCROLL))
$b = GUICtrlCreateButton("+",475,2,25,25)
$b2 = GUICtrlCreateButton("-",475,40,25,25)
$bsave = GUICtrlCreateButton("Save", 150, 450, 80, 30)
$bmodify = GUICtrlCreateButton("Modifica", 50, 450, 80, 30)
$item = GUICtrlCreateInput("",20,50,100,20)
$item2 = Guictrlcreateinput("",150,50,100,20)
;$item3 = GuiCtrlCreateInput("",??,??,??,??)
GUICtrlSetFont($b,20,600)
GUISetState(@SW_SHOW)

Global $k=1, $k2=1

Do
$asd= IniRead("asd.ini","a",$k,"")
    $asd2= IniRead("asd.ini","p",$k2,"")
    $k=$k +1
    $k2=$k2 +1
GUICtrlCreateListViewItem($asd&"|"&$asd2&"|",$lista)
Until IniRead("asd.ini","a",$k,"") = ("") And IniRead("asd.ini","p",$k2,"") = ("")


While 1
    Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
            Exit
         case $bmodify

            Case $b2
                _GUICtrlListView_DeleteItemsSelected($lista)
                


                ;item obviously deleted from the list


        Case $b
            if GUICtrlRead($item) = ('') Then
                MsgBox(16,"Errore!", "Errore: Nessuna informazione inserita!",3)
            Else
                GUICtrlCreateListViewItem(GUICtrlRead($item)&"|"&GUICtrlRead($item2)&"|",$lista)
                IniWrite("asd.ini","a",$k, GUICtrlRead($item))
                IniWrite("asd.ini","p",$k2,GUICtrlRead($item2))
                $k=$k +1
                $k2=$k2 +1
            GUICtrlSetData($item,"")
            GUICtrlSetData($item2,"")
        EndIf
    EndSwitch
WEnd
Edited by Doctorkirk
Link to comment
Share on other sites

  • Moderators

Doctorkirk,

If you were to restructure your .ini file along the lines that kylomas suggested in post #25 you might find that people were more ready to hlep. As it is you have a .ini file structure that is "not fit for purpose" and so offering any help would be counterproductive in the extreme. Why use this: :huh:

[a]
1=a
2=b

when you can use human understandable titles such as: :thumbsup:

[My Bank]
name=www.some.url
user=my username
pswd=my password
sec1=security question1
ans1=security question 1 answer

Can you not see that code such as:

Do
    $asd= IniRead("asd.ini","a",$k,"")
    $asd2= IniRead("asd.ini","p",$k2,"")
    $k=$k +1
    $k2=$k2 +1
GUICtrlCreateListViewItem($asd&"|"&$asd2&"|",$lista)
Until IniRead("asd.ini","a",$k,"") = ("") And IniRead("asd.ini","p",$k2,"") = ("")

is not that easy to debug? :huh:

I did suggest earlier that ignoring the advice of a long-term member was not the cleverest thing to do - perhaps you can now see why. So I suggest you forget about

it would be waste a Sunday past on the PC rewriting the code and try to find a way to write the file and list the value the way i want...

and produce some code which we might be prepared to debug. Hint taken? ;)

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

Hint taken? ;)

Got it! :D

when you can use human understandable titles such as: :thumbsup:

I know that would be better (for me to find the records too), but i can't find the way to list it in a GuiCtrlListView with some (in this case 3) columns... i use that way to search and write the records from the ini file until it found a blank/unexhistant record, so i can list it, but the problem is to get the text from the list and delete it from the ini... this code is drivin' me crazy, it would be more simple to use a single-column list, and get the text normally, deleting it in the ini... but i'm very complicated and if i have to MAKE a program i think that it has to be like i want, did you agree? :)

Btw, if i decide to follow the "well-respected member advice" :P how could i list the records and then maybe find and delete 'em? :D

Link to comment
Share on other sites

  • Moderators

Doctorkirk,

Provide a suitable ini file with some blank records included and I will try and produce some code to get the contents into a 3 column ListView like the one you used above. Deal? ;)

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 can use this sample:

[User]
Item1=Username|Password|Url/exe|etc|etc|etc
Item2=Username|Password|Url/exe|etc|etc|etc
to get the records like username, password, etc we can use a iniread with a stringsplit comand... can this be more suitable for this purpose? :) 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...