-
Notifications
You must be signed in to change notification settings - Fork 1
/
PinAuth Test_INI.ahk
46 lines (27 loc) · 1.04 KB
/
PinAuth Test_INI.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#singleInstance force
#persistent
#include *i <Lib_1>
#include <PIN_INI>
pin:="1234" ; test PIN
str:="Hello World" ; str to test with
key:="Test" ; ini key name
pinAuthObj:=new pinAuth ; create new object
pinAuthObj.setPin(pin) ; set pin
pinAuthObj.setStr(str,key) ; set/save string
dStr:=pinAuthObj.getStr(key) ; get saved string
msgbox % dStr ; show decrypted string
pinAuthObj.removeStr(key) ; remove saved string
pinAuthObj.getStr(key) ; check for removed key (throws error)
pinAuthObj:= ; release object
; check explicit paths w/ explicit section
header:="Test" ; INI section name
fileName:="file.ini" ; INI file name
pinAuthObj:=new pinAuth(a_scriptDir,fileName)
pinAuthObj.setPin(pin) ; set pin
pinAuthObj.setStr(str,key,header) ; set/save string
dStr:=pinAuthObj.getStr(key,header) ; get saved string
msgbox % dStr ; show decrypted string
pinAuthObj.removeStr(key,header) ; remove saved string
pinAuthObj.removeStr("",header) ; remove entire section
pinAuthObj:= ; release object
exitApp