CODICE
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.6.0
Script Version: 0.1.1 Beta
Author: Gianlu-thebest
Script Function:
Write Diary pages in a folder secret!
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
; ----Include----
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GUIEdit.au3>
; --End Include--
$dir_secret = @AppDataDir&"\Secret"
$ini = @AppDataDir&"\ini.ini"
If Not FileExists($dir_secret) Then DirCreate($dir_secret)
If Not FileExists($ini) Then FileOpen($ini,2)
If IniRead($ini,"PASS","pass","") = "" Then
_Main()
Else
$pass=InputBox("Inserisci Password:","Inserisci la password:","","*")
If $pass = IniRead($ini,"PASS","pass","") Then _Main()
EndIf
Func _Main()
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Diary Writer", 667, 498, 192, 124)
$Edit1 = _GUICtrlEdit_Create($Form1,"", 16, 32, 633, 353)
$Label1 = GUICtrlCreateLabel("Write your Page:", 8, 8, 83, 17)
$Button1 = GUICtrlCreateButton("Salva", 8, 392, 75, 25, 0)
$Button2 = GUICtrlCreateButton("Apri cartella", 88, 392, 75, 25, 0)
$Button3 = GUICtrlCreateButton("Imposta Password", 168, 392, 99, 25, 0)
$Button4 = GUICtrlCreateButton("Elimina password", 272, 392, 99, 25, 0)
$Button5 = GUICtrlCreateButton("Cancella tutto", 376, 392, 75, 25, 0)
$Button6 = GUICtrlCreateButton("Pulisci Edit", 456, 392, 75, 25, 0)
$Button7 = GUICtrlCreateButton("Resetta",535,392)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
If IniRead($ini,"pass","pass","") = '' Then
GUICtrlSetState($Button4,128)
Else
GUICtrlSetState($Button3,128)
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$Edit_Text=_GUICtrlEdit_GetText($Edit1)
$NOME=InputBox("Nome File","Inserisci il nome del file ( la cartella è segreta! )")
If Not @error Or $nome = "" Then
$file_open=FileOpen($dir_secret&"\"&$nome,2)
FileWrite($file_open,$Edit_Text)
If @error Then MsgBox(16,"Errore","Errore!")
FileClose($File_open)
MsgBox(64,"Completato","Completato!")
EndIf
Case $Button2
ShellExecute($dir_secret)
Case $Button3
If IniRead($ini,"PASS","pass",'Nessuna') = "Nessuna" Then
$pass=InputBox("Inserisci Password","Inserisci Password:","","*")
If Not @error Or $pass = "" Then
IniWrite($ini,"PASS","pass",$pass)
MsgBox(64,"Password","Password impostata correttamente!")
EndIf
Else
$pass_ins = InputBox("Inserisci la password:","Inserisci la password per modificare quella corrente:","","*")
If $pass_ins = IniRead($ini,"PASS","pass","") Then
$pass=InputBox("Inserisci Password","Inserisci Password:","","*")
If Not @error Or $pass = "" Then
IniWrite($ini,"PASS","pass",$pass)
MsgBox(64,"Password","Password impostata correttamente!")
GUICtrlSetState($Button4,$GUI_ENABLE)
EndIf
Else
MsgBox(48,"Password","Password Non corretta!")
EndIf
EndIf
Case $Button4
If IniRead($ini,"PASS","pass","") = '' Then
MsgBox(48,"Password","Non è impostata nessuna password!")
Else
$pass_del=InputBox("Inserisci la password:","Inserisci la password per eliminarla:","","*")
If $pass_del = IniRead($ini,"PASS","pass","") Then
$msgh=MsgBox(48+4,"Eliminare?","Eliminare Password?")
If $msgh = 6 Then
IniDelete($ini,"PASS","pass")
MsgBox(64,"Password Eliminata","Password eliminata!")
GUICtrlSetState($Button3,$GUI_ENABLE)
EndIf
Else
MsgBox(64,"Password","Password non corretta")
EndIf
EndIf
Case $Button5
$msg=MsgBox(32+4,"Cancellare","Cancellare?")
If $msg = 6 Then FileDelete($dir_secret&"\*.*")
Case $Button6
_GUICtrlEdit_SetText($Edit1,"")
Case $Button7
FileDelete($ini)
Exit
EndSwitch
WEnd
EndFunc;==> _Main()