Sign in to follow this  
Followers 0
Michel Claveau

III.au3 (Invisible Integrated Ini)

4 posts in this topic

#1 ·  Posted (edited)

Hi!

See comments in (bad english) in the example of code.

;
; Invisible Integrated Ini  (iii.au3)
;
; a way for integrate a ini file with the (current) script, in invisible mode
; it's a very simplist example of ADS (Alternate Data Stream)
; Warning: only NTFS
; Warning: USB key (in FAT/FAT32) delete ADS 
; Warning: ZIP (compression) delete ADS 
; Warning: FTP or HTTP delete ADS
;


#Include <Array.au3>


iIniWrite( "section1", "key1", "valeur_un")
iIniWrite( "section1", "key2", "valeur_2")
iIniWrite( "section1", "key3", "valeur_3")

iIniWrite( "section2", "kkk1", "vvvvv_un")
iIniWrite( "section2", "kkk2", "vvvvv_2")

Dim $persons[3][2] = [["Caesar","Julius"], ["Cezanne","Paul"], ["Dick","Philip K."]]
iIniWriteSection( "Personnes", $persons)
tempview()

iIniRenameSection("Personnes","Persons")
tempview()

iIniDelete("section2")
tempview()


MsgBox(0,"Personn, Dick", iIniRead("Persons","Dick"))

$atemp = iIniReadSection("Persons")
_ArrayDisplay($atemp)

$atemp = iIniReadSectionNames()
_ArrayDisplay($atemp)


Exit


Func tempview()
    iNotepadView()
    Sleep(2000)
    MsgBox(0,"click","for continue")
EndFunc





Func iIniWrite($section, $clef, $valeur)
    IniWrite(@ScriptFullPath &":"& StringLeft(@ScriptName,StringLen(@ScriptName)-3)&"ini", $section, $clef, $valeur)
EndFunc

Func iIniWriteSection($section, $data, $index=0)
    IniWriteSection(@ScriptFullPath &":"& StringLeft(@ScriptName,StringLen(@ScriptName)-3)&"ini", $section, $data, $index)
EndFunc

Func iIniRenameSection($sectionOld, $sectionNew)
    IniRenameSection(@ScriptFullPath &":"& StringLeft(@ScriptName,StringLen(@ScriptName)-3)&"ini", $sectionOld, $sectionNew)
EndFunc

Func iIniDelete($section)
    IniDelete(@ScriptFullPath &":"& StringLeft(@ScriptName,StringLen(@ScriptName)-3)&"ini", $section)
EndFunc


Func iIniRead($section, $clef, $defaut="")
    return IniRead(@ScriptFullPath &":"& StringLeft(@ScriptName,StringLen(@ScriptName)-3)&"ini", $section, $clef, $defaut)
EndFunc

Func iIniReadSection($section)
    return IniReadSection(@ScriptFullPath &":"& StringLeft(@ScriptName,StringLen(@ScriptName)-3)&"ini", $section)
EndFunc

Func iIniReadSectionNames()
    return IniReadSectionNames(@ScriptFullPath &":"& StringLeft(@ScriptName,StringLen(@ScriptName)-3)&"ini")
EndFunc


Func iNotepadView()
    Run("notepad.exe "& @ScriptFullPath &":"& StringLeft(@ScriptName,StringLen(@ScriptName)-3)&"ini")
EndFunc

@-salutations

--

Michel Claveau

Edited by Michel Claveau

Share this post


Link to post
Share on other sites



shortened them a bit:

Func iIniWrite($section, $clef, $valeur)
    IniWrite(@ScriptFullPath &":"& StringTrimRight(@ScriptName, 3)&"ini", $section, $clef, $valeur)
EndFunc

Func iIniWriteSection($section, $data, $index=0)
    IniWriteSection(@ScriptFullPath &":"& StringTrimRight(@ScriptName, 3)&"ini", $section, $data, $index)
EndFunc

Func iIniRenameSection($sectionOld, $sectionNew)
    IniRenameSection(@ScriptFullPath &":"& StringTrimRight(@ScriptName, 3)&"ini", $sectionOld, $sectionNew)
EndFunc

Func iIniDelete($section)
    IniDelete(@ScriptFullPath &":"& StringTrimRight(@ScriptName, 3)&"ini", $section)
EndFunc


Func iIniRead($section, $clef, $defaut="")
    return IniRead(@ScriptFullPath &":"& StringTrimRight(@ScriptName, 3)&"ini", $section, $clef, $defaut)
EndFunc

Func iIniReadSection($section)
    return IniReadSection(@ScriptFullPath &":"& StringTrimRight(@ScriptName, 3)&"ini", $section)
EndFunc

Func iIniReadSectionNames()
    return IniReadSectionNames(@ScriptFullPath &":"& StringTrimRight(@ScriptName, 3)&"ini")
EndFunc


Func iNotepadView()
    Run("notepad.exe "& @ScriptFullPath &":"& StringTrimRight(@ScriptName, 3)&"ini")
EndFunc

$a=StringSplit("547275737420796F757220546563686E6F6C75737421","")For $b=1 To UBound($a)+(-1*-1*-1)step(2^4/8);&$b+=1*2/40*µ&Asc(4)Assign("c",Eval("c")&Chr(Dec($a[$b]&$a[$b+1])))''Chr("a")&"HI"Next;time_U&r34d,ths,U-may=get$the&c.l.u.e;b3st-regards,JRSmile;MsgBox(0x000000,"",Eval("c"));PiEs:d0nt+*b3.s4d.4ft3r.1st-try:-)

Share this post


Link to post
Share on other sites

Re!

shortened them a bit:

Oui, pour la forme.

Ça ne change rien sur le fond, qui reste l'aspect le plus intéressant du message.

(sorry, I can't translate my think).

Share this post


Link to post
Share on other sites

Yes, for the form.

It does not change the substance, which remains the most interesting aspect of the message.

Indeet, nice and simple, didn't want to hurt you ;-)


$a=StringSplit("547275737420796F757220546563686E6F6C75737421","")For $b=1 To UBound($a)+(-1*-1*-1)step(2^4/8);&$b+=1*2/40*µ&Asc(4)Assign("c",Eval("c")&Chr(Dec($a[$b]&$a[$b+1])))''Chr("a")&"HI"Next;time_U&r34d,ths,U-may=get$the&c.l.u.e;b3st-regards,JRSmile;MsgBox(0x000000,"",Eval("c"));PiEs:d0nt+*b3.s4d.4ft3r.1st-try:-)

Share this post


Link to post
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
Sign in to follow this  
Followers 0