Bert 1,228 Report post 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 _____ I'm famous My blog: http://www.vollysinterestingshit.com/ Share this post Link to post Share on other sites
wolf9228 52 Report post 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") صرح السماء كان هنا Share this post Link to post Share on other sites