Bert Posted February 1, 2009 Posted February 1, 2009 I have an array. I do not know the number of items in the array for I'm reading a ini file to get the section names. I need to decrypt the section names in the array. Could I get an example of how to do this? Thanks The Vollatran project My blog: http://www.vollysinterestingshit.com/
wolf9228 Posted February 1, 2009 Posted February 1, 2009 expandcollapse popup#include <Array.au3> #Include <String.au3> FileDelete(@ScriptDir & "\win.ini") FileDelete(@ScriptDir & "\win2.ini") Dim $myArray[10] $arrayitems = (UBound($myArray) - 1) MsgBox(0,"", "array items ==>" & $arrayitems) For $i = 1 To 10 Step 1 $section = "section" & $i $key = "key" & $i $Data = "Data" & $i IniWrite(@ScriptDir & "\win.ini", $section, $key, $Data) Next $arrayIni = IniReadSectionNames(@ScriptDir & "\win.ini") $arrayIni_items = $arrayIni[0] $arrayIni_items2 = (UBound($arrayIni) - 1) MsgBox(0,"", "arrayIni_items ==> " & $arrayIni_items & " Or " & "arrayIni_items2 ==> " & $arrayIni_items2) For $i = 1 To $arrayIni_items2 Step 1 MsgBox(0,"", "SectionNames ==> " & $arrayIni[$i]) Next $i_Encrypt = 1 ;encrypt $s_EncryptPassword = 'Password' $i_EncryptLevel = 1 For $i = 1 To 10 Step 1 $section = "section" & $i $key = "key" & $i $Data = "Data" & $i $encrypt = _StringEncrypt($i_Encrypt, $section, $s_EncryptPassword, $i_EncryptLevel) IniWrite(@ScriptDir & "\win2.ini", $encrypt, $key, $Data ) Next $arrayIni = IniReadSectionNames(@ScriptDir & "\win2.ini") _ArrayDisplay( $arrayIni, "encrypt") $i_Encrypt = 0 ;decrypt $s_EncryptPassword = 'Password' $i_EncryptLevel = 1 $arrayIni = IniReadSectionNames(@ScriptDir & "\win2.ini") For $i = 1 To $arrayIni_items Step 1 $s_EncryptText = $arrayIni[$i] $decrypt = _StringEncrypt($i_Encrypt, $s_EncryptText, $s_EncryptPassword, $i_EncryptLevel) $arrayIni[$i] = $decrypt Next _ArrayDisplay( $arrayIni, "decrypt") صرح السماء كان هنا
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now