Search the Community

Showing results for tags 'file'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Chat
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum
  • AutoIt

Calendars

  • Community Calendar

Found 93 results

  1. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.4.3 Author: usmiv4o Script Function: AutoIt script to check if files in directory are changed. It is usefull for security contra-inteligense measures. Function Name: LoadTripwireDB() Description: Loads database (text file tripwire.txt) and compare files in /test folder for changes. compares Hash (MD5) checksums. If they are not the same starts Initial() Function Name: Initial() Description: Checks directory and makes index of files and their MD5 checksums in text file (tripwire.txt) Function Name: Hush() Description: Checks file and returns its MD5 checksum. Requirement(s): Windows XP Return Value(s): On Success - Returns true. Files are the same as before. On Failure - return false. Example: LoadTripwireDB() #ce ---------------------------------------------------------------------------- #include <Crypt.au3> #include <File.au3> #include <Array.au3> $sDir = @ScriptDir & "\Test" $sFilePath = @ScriptDir & "\tripwire.txt" Func Hush(ByRef $sFile) $sRead = FileOpen( $sFile) $dHash = _Crypt_HashData($sRead, $CALG_MD5) ; Create a hash of the text entered. ConsoleWrite("Hash of file " & $sFile & " is " & $dHash & @CRLF) EndFunc ;ConsoleWrite("Files in Dir are " & $aScriptDir[0] & @CRLF) ;$sFilePath = @ScriptDir & "\Examples.txt" ;_FileWriteFromArray($sFilePath, $aScriptDir, 1) ;_ArrayDisplay($aScriptDir, "1D display") Func Initial() $aScriptDir = _FileListToArray($sDir) for $i = 1 To UBound($aScriptDir) - 1 $dHash = _Crypt_HashData($i, $CALG_MD5) ;ConsoleWrite("File " & $aScriptDir[$i] & " is " & $dHash & @CRLF) ConsoleWrite($aScriptDir[$i] & ":" & $dHash & @CRLF) ;Hush($aScriptDir[$i]) ;FileWrite $hFileOpen = FileOpen($sFilePath, $FO_APPEND) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.") EndIf FileWrite($hFileOpen, $aScriptDir[$i] & ":" & $dHash & @CRLF) Next EndFunc Func Monitor() $aScriptDir = _FileListToArray($sDir) for $i = 1 To UBound($aScriptDir) - 1 Next EndFunc Func LoadTripwireDB() $comparison_ok = false $dArray = _FileListToArray($sDir) ;directory $dArray0 = UBound($dArray) - 1 $fArray = FileReadToArray($sFilePath) ;file $fArray0 = UBound($fArray) ;_ArrayDisplay($dArray, "files array") if $dArray0 = $fArray0 Then ; are file same as recorded in txt file? ;ConsoleWrite("files in monitoring dir: " & $dArray[0] & " = file recorded: " & $fArray0 & @CRLF & $fArray[0]& @CRLF) for $i = 1 To UBound($dArray) - 1 ;ConsoleWrite("i = " & $i & @CRLF) $dHash = _Crypt_HashData($i, $CALG_MD5) ;binary ;$dHash = BinaryToString($dHash) $ffhash = StringSplit( $fArray[$i-1],":") $fhash = $ffhash[2] ;ConsoleWrite("IsBinary $dHash " & IsBinary($dHash) & @CRLF) if $dHash = $fhash Then ;if compared hashes are equal ;ConsoleWrite($fhash & ":" & $dHash & " equal" & @CRLF) ;ConsoleWrite("File: " & $fhash & @CRLF & "Directory: " & $dHash & @CRLF & "equal: yes " & @CRLF) Else ;if compared hashes are not equal ;ConsoleWrite("File: " & $fhash & @CRLF & "Directory: " & $dHash & @CRLF & "equal: not " & @CRLF) ;MsgBox(0,"hash md5",$fhash & ":" & $dHash & " not equal") EndIf Next ;ConsoleWrite("hashes are equal" & @CRLF) $comparison_ok = true Else ConsoleWrite("number of files in monitoring dir are not same as recorded" & @CRLF) ConsoleWrite("directory: " & $dArray[0] &":"& "files: " & UBound($fArray) - 1 & @CRLF) EndIf Return $comparison_ok EndFunc #main if LoadTripwireDB() = true Then ConsoleWrite(" hashes are equal " & @CRLF) ElseIf LoadTripwireDB() <> true Then ConsoleWrite(" hashes are not equal " & @CRLF) ConsoleWrite(" hashes are not equal " & @CRLF) Initial() EndIf tripwire.au3 tripwire.txt
  2. What's the best way to receive file from a desktop app? app.exe will execute a cmd with "au3file.exe /path/of/the/file.xml" and the au3file.exe will get and delete that. Or else? THE MOST IMPORTANT PART OF THE QUESTION And best way to transfer file to a desktop app? au3file.exe do a $_POST request and the app.exe MUST HAVE a local HTTP server that can receive $_POST, but it looks heavy 'cause the app must have a server such XAMPP. au3file.exe execute a cmd with "app.exe /path/of/the/file.xml" and the app.exe will now get that file and delete. Or else?
  3. Good evening everyone I'm working on this little project for a week, and, what I'm trying to do could be useful for many users as well... I'm trying to do a "Report Generator", which reads the data that have to report from a text file (.txt) formatted with this pattern; Data1;Data2;Data3;Data4;Data5;; YES, there are 2 semi-colon at the end of the line. In detail, Data1 is a date/time stamp with this format: YYYY/MM/DD HH:MM:SS ; When the script starts, the user is prompted to choose 2 dates which I'll call as: Report_Date_Start; Report_Date_Start. So, the report, should cover all dates between Report_Date_Start AND Report_Date_End. And, already at this point, I don't know how to do the query... How can I say to the script: SELECT * FROM (.txt) WHERE Data1 BETWEEN Report_Date_Start AND Report_Date_End; ? I thought that I could do a _DateDiff, but if the difference between the two dates is months and not days, how can I do the trick? Should I make a Switch...Case with the _DateDiff() and see then calculate all the dates between Report_Date_Start AND Report_Date_End... But then, how can I compare the dates in the file with all the dates between Report_Date_Start AND Report_Date_End? I'm going crazy, I know... I've already made a "Export Tool", which exports the content of the .txt file in a .db, managed with SQLite... I mean, there I could easily do a query like I did above the thread, but, this "export", for 1080 rows, takes 28 seconds to be done. And, 1080 rows are daily rows that are added every day in the .txt file, so, in a week, the file could be easily 7000+ rows, which means that the "export" would take 3 minutes to be done... And we can go over and over... I'll post just for be "complete" what I've done about the export, so, maybe, someone could say how to improve it in terms of efficency... Local $aContenutoFileAuditReport = "" _FileReadToArray($sFileAudit_Report, $aContenutoFileAuditReport) If(IsArray($aContenutoFileAuditReport) And Not @error) Then Local $aContenutoFileAuditReport_Splitted = "" Local $sQuery = "" Local $hInizioConteggio = TimerInit() For $i = 1 To UBound($aContenutoFileAuditReport) - 1 $aContenutoFileAuditReport_Splitted = StringSplit($aContenutoFileAuditReport[$i], ";") $sQuery = "INSERT INTO FileDB_Report(DATESTAMP, TIMESTAMP, USER_ID, OBJECT_ID, DESCRIPTION, COMMENT) " & _ "VALUES(" & _ _SQLite_FastEscape($aContenutoFileAuditReport_Splitted[0]) & "," & _ _SQLite_FastEscape($aContenutoFileAuditReport_Splitted[1]) & "," & _ _SQLite_FastEscape($aContenutoFileAuditReport_Splitted[3]) & "," & _ _SQLite_FastEscape($aContenutoFileAuditReport_Splitted[4]) & "," & _ _SQLite_FastEscape($aContenutoFileAuditReport_Splitted[5]) & "," & _ _SQLite_FastEscape($aContenutoFileAuditReport_Splitted[6]) & ");" If(_SQLite_Exec($hFileDB_Report, $sQuery) <> $SQLITE_OK) Then ConsoleWrite("Errore durante l'esecuzione della query #" & $i & @CRLF) Else ConsoleWrite("Query eseguita correttamente #" & $i & @CRLF) EndIf Next ConsoleWrite("Esportazione completata in: " & Round(TimerDiff($hInizioConteggio)/1000, 0) & " secondi") Else MsgBox($MB_ICONERROR, "Errore!", "Errore durante la lettura del file nell'array." & @CRLF & "Errore: " & @error) EndIf I know that I can't do queries from a .txt file... [19:18] I've been writing this post from 18:40 maybe... By the way, if @jchd or someone else could tell me if I can import a formatted .txt file in SQLite and then, do queries on the DB, I'd be very happy for that... About the report in PDF, I'm talking with @taietel in order to know how to create a PDF. I hope someone will help me Sorry for the "long" list of questions... Thank you for everything you've done for me I have to say that this is the community of programming language that I've loved most! By the way, I'll be back tomorrow in the morning ( ~ 9:15 a.m. Italian time ), so, excuse me if I can't answer before that time. Hope you guys have a wonderful day/night. Thanks again Francesco
  4. Send "Drag & Drop File(s)" Message I was looking for this functionality before, and couldn't figure out the correct method for using the WM_DROPFILES message. Thankfully today I came across the thread ' and found working, but flawed, code for doing exactly this. Specifically, (his 'DoDragDrop' function). I cleaned up the code, added error checking, Unicode & x64 support, and fixed the Global memory management issues. The result is down below. Also, see ProgAndy's COM implementation of Drag&Drop: ' Another good reference, besides those in the thread above, is this article at CodeProject: 'How to Implement Drag and Drop Between Your Program and Explorer' Examples of usage: TeraCopy _FileDragDrop(WinGetHandle("[REGEXPTITLE:TeraCopy.*]"),@ScriptFullPath&'|'&@AutoItExe) Notepad++: $hNPPlus=WinGetHandle("[CLASS:Notepad++]") $aNPPPos=WinGetPos($hNPPlus) ;~ WinActivate($hNotePad) $sProgramFiles=@ProgramFilesDir If @AutoItX64 Then $sProgramFiles&=' (x86)' $iRet=_FileDragDrop($hNPPlus,@ScriptFullPath&'|'&$sProgramFiles&"\AutoIt3\Include\Memory.au3",$aNPPPos[2]/2,$aNPPPos[3]/2) ConsoleWrite("Return: "&$iRet&" @error="&@error&", @extended="&@extended&@CRLF) Be sure to credit the original authors, or leave the headers intact, if you use the code *edit: for some friggin reason I can't post the code in the post - I get a 'You must enter a post' error message - wtf. Attaching it for now.. UPDATES: 2010-12-4 (yup, today!): Fixed ANSI implementationChanged Memory allocation type to 'Fixed' (thanks trancexx)Added X, Y position parameters - actually needed for some programs (Notepad++ for example)_FileDragDrop.au3
  5. We can get a list of file using the below code. Local $aFileList = _FileListToArray(@DesktopDir, "*") Is there any option to use the above one recursively to get sub folders and their contents also.?? And also, is there any way to serialize the above array locally to some file and load it later when we want in another program on another machine so that we can compare its contents with a folder in different machine, which is not network connected also.?
  6. Hi, I have a property file format configuration file for our project. The sample file is as below. BuildLocation:C:\Build BuildExe:erwin Data Modeler r9.7 (64-bit)_2378.exe Release:r9.64.02 Silent:No InstallPath:default Compare :No MartUpgrade :Yes Bit:64 ERwinUpgrade:No License_File:150416-1952 Navigator (ca.com).lic To read this file, I am using below code. Func readConfig($sFilePath,$intStartCode) ;Usage: MsgBox(0,"Silent",readConfig(@ScriptDir&"\Config.txt","Silbent")) ;$sReplaceText = "Mani Prakash" ;$sFilePath = "C:\Users\KIRUD01\Desktop\Config.txt" ;$intStartCode = "BuildExe" $arrRetArray = "" $s = _FileReadToArray($sFilePath, $arrRetArray);Reading text file and saving it to array $s will show status of reading file.. For $i = 1 To UBound($arrRetArray)-1 $line = $arrRetArray[$i];retrieves taskengine text line by line If StringInStr($line, $intStartCode) Then ConsoleWrite ("Starting point "& $line & @CRLF) return StringStripWS(StringSplit($line,":")[2],$STR_STRIPLEADING + $STR_STRIPTRAILING ) EndIf if $i = UBound($arrRetArray)-1 then return "Not Found" Next EndFunc The above code is working to read the particular key value. But problem is , if I try to read the key "Bit" it is giving the value of key "BuildExe" as the line contains the word "bit".. Can you suggest how to do this. If possible I need to fix writeConfig also. Func writeConfig($sFilePath,$intStartCode,$sReplaceText) ;$sReplaceText = "Mani Prakash" ;$sFilePath = "C:\Users\KIRUD01\Desktop\Config.txt" ;$intStartCode = "BuildExe" $arrRetArray = "" $s = _FileReadToArray($sFilePath, $arrRetArray);Reading text file and saving it to array $s will show status of reading file.. $intStartingPointFound = 0 For $i = 1 To UBound($arrRetArray)-1 $line = $arrRetArray[$i];retrieves taskengine text line by line If StringInStr($line, $intStartCode) Then $intStartingPointFound = 1;if found the starting point of the module to copy then set this variable to 1 ConsoleWrite ("Starting point " & @CRLF) $arrRetArray[$i] = $intStartCode & ": " & $sReplaceText ExitLoop EndIf if $i = UBound($arrRetArray)-1 then ConsoleWrite("Not Found" & @CRLF) Next _FileWriteFromArray ($sFilePath, $arrRetArray,1) EndFunc
  7. Hey, I've coma accross a very odd problem. I want to download a CSV-File, and process the contents. This is the extremely simplyfied AutoIT-Code, given the file is already downloaded: $f= @ScriptDir & "\TestFile.csv" $file = FileOpen($f,0) Local $line = FileReadLine($file) MsgBox(0,"",$line) The downloaded CSV file I want to process contains something like this: Artikelnummer;EAN-Code;Artikelname;Artikelgewicht;Beschreibung;Kurzbeschreibung;Eigenschaften;Technische-Daten;Bild1;Bild2;Bild3;Bild4;Bild5;Bild6;Bild7;Bild8;Lieferbar;"Lieferbar Ab";Versandzeit;"UVP-Preis inkl. MwSt.";"Preis1";"Preis2";Hersteller L7335272;5420025602129; Mini Light XLR ;0.1000; JB Systems Schwanenhalsleuchte mit XLR Anschluss. ;;;;http://www.example.com/media/images/org/pic20070114153500a.jpg;;;;;;;;JA;; 1-3 Tage ;12,90;12,90;6,57; JB Systems L3320502;540207025601636; Mini Light LED BNC ;0.1000; JB Systems LED Schwanenhalsleuchte mit BNC Anschluss. ;;;;http://www.example.com/media/images/org/pic20061231171705a.jpg;;;;;;;;JA;; 1-3 Tage ;29,90;25,89;15,26; JB Systems L1332254;542002556023143; Mini Light LED XLR ;0.1000; JB Systems LED Schwanenhalsleuchte mit XLR Anschluss. ;;;;http://www.example.com/media/images/org/pic20061231171728a.jpg;;;;;;;;JA;; 1-3 Tage ;29,90;25,89;15,26; JB Systems L8302591;504200256280277; Spiegelkugel 10cm ;0.5000; JB Systems Spiegelkugel 10cm Durchmesser mit einer hohen Dichte durch 10 x 10 mm Echtglasspiegel. ;;;;http://www.example.com/media/images/org/pic20060324214825a.jpg;;;;;;;;JA;; 1-3 Tage ;5,50;4,90;2,81; JB Systems L7302932;542000256510222; Spiegelkugel 20cm ;0.8400; JB Systems Spiegelkugel 20cm Durchmesser mit einer hohen Dichte durch 10 x 10 mm Echtglasspiegel. ;;;;http://www.example.com/media/images/org/pic20060324214907a.jpg;;;;;;;;JA;; 1-3 Tage ;12,90;11,50;6,58; JB Systems L2350293;534200562064239; Spiegelkugel 30cm ;2.1300; JB Systems Spiegelkugel 30 cm Durchmesser mit einer hohen Dichte durch 10 x 10 mm Echtglasspiegel. ;;;;http://www.example.com/media/images/org/pic20060324214956a.jpg;;;;;;;;JA;; 1-3 Tage ;26,90;23,00;13,72; JB Systems L3302984;545200252024246; Spiegelkugel 40cm ;3.5000; JB Systems Spiegelkugel 40cm Durchmesser mit Sicherungsring und einer hohen Dichte durch 10 x 10 mm Echtglasspiegel. ;;;;http://www.example.com/media/images/org/pic20060324215050a.jpg;;;;;;;;JA;; 1-3 Tage ;54,90;49,00;28,00; JB Systems L9302495;542205056225600; Spiegelkugel 50cm ;5.3900; JB Systems Spiegelkugel 50cm Durchmesser mit Sicherungsring und einer hohen Dichte durch 10 x 10 mm Echtglasspiegel. ;;;;http://www.example.com/media/images/org/pic20060324215122a.jpg;;;;;;;;JA;; 1-3 Tage ;89,00;79,00;45,39; JB Systems But the message box that pops up after FileReadLine contains this: 䅲瑩步汮畭浥爻䕁中䍯摥㭁牴楫敬湡浥㭁牴楫敬来睩捨琻䉥獣桲敩扵湧㭋畲穢敳捨牥楢畮朻䕩来湳捨慦瑥渻呥捨湩獣桥ⵄ慴敮㭂楬搱㭂楬搲㭂楬搳㭂楬搴㭂楬搵㭂楬搶㭂楬搷㭂楬搸㭌楥晥牢慲㬢䱩敦敲扡爠䅢∻噥牳慮摺敩琻≕噐ⵐ牥楳⁩湫氮⁍睓琮∻≐牥楳ㄢ㬢偲敩猲∻䡥牳瑥汬敲ੌ㜳㌵㈷㈻㔴㈰〲㔶〲ㄲ㤻M楮椠䱩杨琠塌刀㬰⸱〰〻J䈠卹獴敭猠卣桷慮敮桡汳汥畣桴攠浩琠塌删䅮獣桬畳献;㬻㭨瑴瀺⼯睷眮數慭灬攮捯洯浥摩愯業慧敳⽯牧⽰楣㈰〷〱ㄴㄵ㌵〰愮橰朻㬻㬻㬻㭊䄻㬀ㄭ㌠呡来;ㄲⰹ〻ㄲⰹ〻㘬㔷㬀䩂⁓祳瑥浳 I've attached both files I use. My guess is, that there's something wrong with the encoding, but I'm not sure how to fix it. Thank you very much for your help - virhonestum Encodingtester.au3 TestFile.csv
  8. IniEx.au3 (INI File Processing Functions) solve many problems, such as the limits of AutoIt Default INI function, and add many other options, since all function work by reference so IniEx.au3 also use less memory, and provide a really good performance in speed #include-Once ; #INDEX# ======================================================================================================================= ; Title .........: IniEx ; AutoIt Version : v3.3.9.22++ ; Language ......: English ; Description ...: INI File Processing Functions ; Author(s) .....: DXRW4E ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ;_IniClearCache() ;_IniCloseFileEx() ;_IniDeleteEx() ;_IniFileWriteEx() ;_IniGetFileInformationEx() ;_IniGetFileStringData() ;_IniGetSectionNumberEx() ;_IniOpenFileEx() ;_IniOpenFile() ;_IniReadEx() ;_IniReadSectionEx() ;_IniReadSectionNamesEx() ;_IniRenameSectionEx() ;_IniWriteEx() ;_IniWriteSectionEx() ; =============================================================================================================================== ; #INTERNAL_USE_ONLY# =========================================================================================================== ;__GetSeparatorCharacter() ;__IniFileWriteEx() ;__IniGetFileStringData() ;__IniReadSectionEx() ;__IniSaveCache() ;__IniWriteSectionEx() ; =============================================================================================================================== ; #CONSTANTS# =================================================================================================================== Global Const $INI_STRIPLEADING = 1 ; $STR_STRIPLEADING - strip leading white space Global Const $INI_STRIPTRAILING = 2 ; $STR_STRIPTRAILING - strip trailing white space Global Const $INI_STRIPLEADTRAILING = 3 ; BitOR($STR_STRIPLEADING, $STR_STRIPTRAILING) Global Const $INI_ARRAYDATA = 4 Global Const $INI_ARRAYDATA_NOCOUNT = 8 Global Const $INI_NOWRITEREADONLY = 16 Global Const $INI_FO_UNICODE = 32 ; $FO_UNICODE Global Const $INI_FO_UTF16_LE = 32 ; $FO_UTF16_LE Global Const $INI_FO_UTF16_BE = 64 ; $FO_UTF16_BE Global Const $INI_FO_UTF8 = 128 ; $FO_UTF8 Global Const $INI_FO_UTF8_NOBOM = 256 ; $FO_UTF8_NOBOM Global Const $INI_NOOCCURRENCE = 512 Global Const $INI_MERGE = 1024 Global Const $INI_NOCREATE = 2048 Global Const $INI_APPENDDATA = 4096 Global Const $INI_REPLACEONLY = 8192 Global Const $INI_FO_UTF8_FULL = 16384 ; $FO_UTF8_FULL Global Const $INI_NOOVERWRITE = 32768 Global Const $INI_OVERWRITEALL = 65536 Global Const $INI_IGNOREDUPLICATE = 131072 Global Const $INI_DELETE = 262144 Global Const $INI_RENAME = 524288 Global Const $INI_REMOVE = 1048576 ;Global Const $INI_RESERVED* = 2097152 ;Global Const $INI_RESERVED* = 4194304 ;Global Const $INI_RESERVED* = 8388608 Global Const $INI_OPEN_EXISTING = 16777216 Global Const $INI_CREATEPATH = 33554432 Global Const $INI_REPAIR_ERROR = 67108864 Global Const $INI_DISCARDCHANGES = 134217728 Global Const $INI_OPEN_FILEQUEUE = 268435456 ;Global Const $INI_RESERVED* = 536870912 Global Const $INI_2DARRAYFIELD = 1073741824 ;;;; THESE ARE SPECIAL FLAGS, ARE USED INTERNALLY ONLY ;;;; Global Const $INI_INTERNAL_USE_ONLY = 2147483648 Global Const $INI_FO_STYLE = BitOR(31, $INI_OPEN_EXISTING, $INI_CREATEPATH, $INI_REPAIR_ERROR, $INI_OPEN_FILEQUEUE) Global Const $INI_MERGE_NOOCCURRENCE = BitOR($INI_MERGE, $INI_NOOCCURRENCE) Global Const $INI_REMOVE_RENAME = BitOR($INI_REMOVE, $INI_RENAME) Global Const $INI_REMOVE_DELETE = BitOR($INI_REMOVE, $INI_DELETE) Global Const $INI_NOCREATE_REMOVE_DELETE = BitOR($INI_NOCREATE, $INI_REMOVE, $INI_DELETE) Global Const $INI_NOOCCURRENCE_IGNOREDUPLICATE = BitOr($INI_NOOCCURRENCE, $INI_IGNOREDUPLICATE) Global Const $INI_OVERWRITEALL_APPENDDATA = BitOR($INI_OVERWRITEALL, $INI_APPENDDATA) Global Const $NULL_REF = Null Global Const $sINI_OPENFILE_EX = @LF & "[]" & @LF ;;;; DO NOT EVER USE\CHANGE\EDIT THESE VARIABLES ;;;; ;;;; THESE VARIABLES ARE USED INTERNALLY ONLY ;;;; Global Static $INI_NULL_REF = Null Global Static $_HINI[11][11] = [[10, 0]] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name...........: _IniOpenFileEx ; Description ...: The _IniOpenFileEx function opens an INI file and returns a handle to it. ; Syntax.........: _IniOpenFileEx($sFilePath[, $iFlags]]) ; Parameters ....: $sFilePath - INI File Path ; $iFlags - Optional, (add the flags together for multiple operations): ; This Flags will be ignored if the $INI_CREATEPATH is not set\used ; | A file may fail to open due to access rights or attributes. ; | The default mode when writing text is ANSI - use the unicode flags to change this. When writing unicode files ; | the Windows default mode (and the fastest in AutoIt due to the least conversion) is UTF16 Little Endian (mode 32). ; | $INI_FO_* Flags will be ignored if the $INI_CREATEPATH is not Set\Used ; |$INI_FO_UNICODE or $INI_UTF16_LE (32) - Use Unicode UTF16 Little Endian reading and writing mode. Reading does not override existing BOM. ; |$INI_FO_UTF16_BE (64) - Use Unicode UTF16 Big Endian reading and writing mode. Reading does not override existing BOM. ; |$INI_FO_UTF8 (128) - Use Unicode UTF8 (with BOM) reading and writing mode. Reading does not override existing BOM. ; |$INI_FO_UTF8_NOBOM (256) - Use Unicode UTF8 (without BOM) reading and writing mode. ; |$INI_FO_UTF8_FULL (16384) - When opening for reading and no BOM is present, use full file UTF8 detection. If this is not used then only the initial part of the file is checked for UTF8. ; ;;;;;;;;;;;; ; |$INI_OPEN_EXISTING (16777216) - If the INI File (Path) is Already Open use that (Handle) (Default Always Opens a New) ; |$INI_CREATEPATH (33554432) - Create INI File if does not exist (Default if file not exist Return Error) ; |$INI_REPAIR_ERROR (67108864) - If exist Error when Opening the INI File Repair Error, example as this line (@CRLF & [SectionName & @CRLF) repair in (@CRLF & [SectionName] & @CRLF), Default Return Error ; |$INI_OPEN_FILEQUEUE (268435456) - Open INI file from Memory\Variable, $sFilePath must contain String Text Data of INI file ; Return values .: Success - INI Handle ; Failure - Returns 0 or String\Text of error line (check @Extended for error line number) ; @Error - 0 = No error. ; |1 = File cannot be opened or found. ; |2 = Error when Opening the INI File ; Remarks .......: ; Author ........: DXRW4E ; =============================================================================================================================== Func _IniOpenFileEx($sFilePath, $iFlags = 0) If BitAND($iFlags, $INI_OPEN_EXISTING) Then For $i = 1 To $_HINI[0][0] If $_HINI[$i][2] = $sFilePath Then Return SetError(0, $i, $i) Next EndIf Local $sCS, $_sCS = "\r", $hFilePath, $iFileEncoding, $aFileData, $aErrorLine, $iFO_Style = BitXOR(BitOR($iFlags, $INI_FO_STYLE), $INI_FO_STYLE) If BitAND($iFlags, $INI_OPEN_FILEQUEUE) Then $aFileData = StringRegExpReplace($sINI_OPENFILE_EX & $sFilePath, '\r(?!\n)', @CRLF) ;;;;, '(?<!\r)\n', @CRLF) $sFilePath = "FileQueue" $iFileEncoding = $iFO_Style ;;(StringIsASCII($aFileData) ? 0 : 32) Else $hFilePath = FileOpen($sFilePath) If $hFilePath = -1 Then If Not FileExists($sFilePath) Then If Not BitAND($iFlags, $INI_CREATEPATH) Then Return SetError(1, 0, 0) $iFO_Style += 10 ;;$iFO_Style = 42 EndIf $hFilePath = FileOpen($sFilePath, $iFO_Style) If $hFilePath = -1 Then Return SetError(1, 0, 0) EndIf $aFileData = StringRegExpReplace($sINI_OPENFILE_EX & FileRead($hFilePath), '\r(?!\n)', @CRLF) ;;;;, '(?<!\r)\n', @CRLF) $iFileEncoding = FileGetEncoding($hFilePath) FileClose($hFilePath) EndIf $aErrorLine = StringRegExp($aFileData, '\n\K[\h\f\xb\x0]*\[[^\]\n]*(?:\n|$)', 1) If Not @Error Then Local $iErrorLine = @Extended - (StringLen($aErrorLine[0]) - 1) If Not BitAND($iFlags, $INI_REPAIR_ERROR) Then Return SetError(2, StringSplit(StringLeft($aFileData, $iErrorLine), @LF)[0] - 2, $aErrorLine[0]) $aFileData = StringRegExpReplace($aFileData, '(\n[\h\f\xb\x0]*\[[^\]\r\n]*)(?=[\r\n]|$)', "$1]") EndIf $sCS = __GetSeparatorCharacter($aFileData) If $sCS = @CR Then $_sCS = "" $aFileData = StringRegExpReplace($aFileData & @CRLF & "[", "\n\K(?>[" & $_sCS & "\n\h\f\xb\x0]*\n|\x0*)(?=[\h\f\xb\x0]*\[)", $sCS & "${0}" & $sCS) $aFileData = StringRegExp($aFileData & $sCS, $sCS & "([\h\f\xb\x0]*\[)([^\]\n]*)(\][^\n]*\n)((?>[" & $_sCS & "\n\h\f\xb\x0]*\n)*)([^" & $sCS & "]*)" & $sCS & "([^" & $sCS & "]*)", 3) $aFileData[0] = UBound($aFileData) - 1 If $aFileData[0] < 5 Then Return SetError(1, 0, 0) ; should not happen ever $aFileData[$aFileData[0]] = StringTrimRight($aFileData[$aFileData[0]], 2) For $iHINI = 1 To $_HINI[0][0] If Not $_HINI[$iHINI][0] Then ExitLoop Next If $iHINI > $_HINI[0][0] Then ReDim $_HINI[$iHINI + $iHINI][11] $_HINI[0][0] = $iHINI + $iHINI - 1 EndIf $aFileData[2] = $iHINI If Not $_sCS Then $aFileData[3] = StringAddCR($aFileData[3]) $aFileData[4] = StringAddCR($aFileData[4]) $aFileData[5] = StringAddCR($aFileData[5]) EndIf For $i = 7 To $aFileData[0] Step 6 $_HINI[$iHINI][5] &= @LF & $aFileData[$i] & @CR & $i If Not $_sCS Then $aFileData[$i + 1] = StringAddCR($aFileData[$i + 1]) $aFileData[$i + 2] = StringAddCR($aFileData[$i + 2]) $aFileData[$i + 3] = StringAddCR($aFileData[$i + 3]) $aFileData[$i + 4] = StringAddCR($aFileData[$i + 4]) EndIf Next $_HINI[0][1] += 1 ;;($_HINI[0][1] < 1) ? 1 : $_HINI[0][1] + 1 $_HINI[$iHINI][0] = $iHINI $_HINI[$iHINI][1] = $aFileData $_HINI[$iHINI][2] = $sFilePath $_HINI[$iHINI][3] = $iFileEncoding $_HINI[$iHINI][4] = ($aFileData[0] - 5) / 6 $_HINI[$iHINI][5] = StringReplace($_HINI[$iHINI][5], "\E", "\e", 0, 1) $_HINI[$iHINI][7] = Null Return $iHINI EndFunc ;==>_IniOpenFileEx ; #FUNCTION# ==================================================================================================================== ; Name...........: _IniOpenFile ; Description ...: The _IniOpenFile function opens an INI file and returns a handle to it. ; Parameters ....: the same as the _IniOpenFileEx(), See _IniOpenFileEx() ; Return values .: See _IniOpenFileEx() ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: _IniOpenFile() is the same as the _IniOpenFileEx(), only that _IniOpenFile() force the check\repair of @CR or @LF in @CRLF ; performance\speed does not change much with _IniOpenFileEx(), _IniOpenFile() can only be about 1% or 5% or10% slower ; =============================================================================================================================== Func _IniOpenFile($sFilePath, $iFlags = 0) If BitAND($iFlags, $INI_OPEN_EXISTING) Then For $i = 1 To $_HINI[0][0] If $_HINI[$i][2] = $sFilePath Then Return SetError(0, $i, $i) Next EndIf Local $hFilePath, $iFileEncoding, $aFileData, $aErrorLine, $iFO_Style = BitXOR(BitOR($iFlags, $INI_FO_STYLE), $INI_FO_STYLE) If BitAND($iFlags, $INI_OPEN_FILEQUEUE) Then $aFileData = StringRegExpReplace($sINI_OPENFILE_EX & $sFilePath, '\r\n?', @LF) $sFilePath = "FileQueue" $iFileEncoding = $iFO_Style ;;(StringIsASCII($aFileData) ? 0 : 32) Else $hFilePath = FileOpen($sFilePath) If $hFilePath = -1 Then If Not FileExists($sFilePath) Then If Not BitAND($iFlags, $INI_CREATEPATH) Then Return SetError(1, 0, 0) $iFO_Style += 10 ;;$iFO_Style = 42 EndIf $hFilePath = FileOpen($sFilePath, $iFO_Style) If $hFilePath = -1 Then Return SetError(1, 0, 0) EndIf $aFileData = StringRegExpReplace($sINI_OPENFILE_EX & FileRead($hFilePath), '\r\n?', @LF) $iFileEncoding = FileGetEncoding($hFilePath) FileClose($hFilePath) EndIf $aErrorLine = StringRegExp($aFileData, '\n\K[\h\f\xb\x0]*\[[^\]\n]*(?:\n|$)', 1) If Not @Error Then Local $iErrorLine = @Extended - (StringLen($aErrorLine[0]) - 1) If Not BitAND($iFlags, $INI_REPAIR_ERROR) Then Return SetError(2, StringSplit(StringLeft($aFileData, $iErrorLine), @LF)[0] - 2, $aErrorLine[0]) $aFileData = StringRegExpReplace($aFileData, '(\n[\h\f\xb\x0]*\[[^\]\n]*)(?=\n|$)', "$1]") EndIf $aFileData = StringRegExpReplace($aFileData & @LF & "[", '\n\K(?>[\n\h\f\xb\x0]*\n|\x0*)(?=[\h\f\xb\x0]*\[)', @CR & "${0}" & @CR) $aFileData = StringRegExp($aFileData & @CR, '\r([\h\f\xb\x0]*\[)([^\]\n]*)(\][^\n]*\n)((?>[\n\h\f\xb\x0]*\n)*)([^\r]*)\r([^\r]*)', 3) $aFileData[0] = UBound($aFileData) - 1 If $aFileData[0] < 5 Then Return SetError(1, 0, 0) ; should not happen ever $aFileData[$aFileData[0]] = StringTrimRight($aFileData[$aFileData[0]], 1) For $iHINI = 1 To $_HINI[0][0] If Not $_HINI[$iHINI][0] Then ExitLoop Next If $iHINI > $_HINI[0][0] Then ReDim $_HINI[$iHINI + $iHINI][11] $_HINI[0][0] = $iHINI + $iHINI - 1 EndIf $aFileData[2] = $iHINI $aFileData[3] = StringAddCR($aFileData[3]) $aFileData[4] = StringAddCR($aFileData[4]) $aFileData[5] = StringAddCR($aFileData[5]) For $i = 7 To $aFileData[0] Step 6 $_HINI[$iHINI][5] &= @LF & $aFileData[$i] & @CR & $i $aFileData[$i + 1] = StringAddCR($aFileData[$i + 1]) $aFileData[$i + 2] = StringAddCR($aFileData[$i + 2]) $aFileData[$i + 3] = StringAddCR($aFileData[$i + 3]) $aFileData[$i + 4] = StringAddCR($aFileData[$i + 4]) Next $_HINI[0][1] += 1 ;;($_HINI[0][1] < 1) ? 1 : $_HINI[0][1] + 1 $_HINI[$iHINI][0] = $iHINI $_HINI[$iHINI][1] = $aFileData $_HINI[$iHINI][2] = $sFilePath $_HINI[$iHINI][3] = $iFileEncoding $_HINI[$iHINI][4] = ($aFileData[0] - 5) / 6 $_HINI[$iHINI][5] = StringReplace($_HINI[$iHINI][5], "\E", "\e", 0, 1) $_HINI[$iHINI][7] = Null Return $iHINI EndFunc ;==>_IniOpenFileEx ; #FUNCTION# ==================================================================================================================== ; Name...........: _IniCloseFileEx ; Description ...: The _IniCloseFileEx function closes the INI file opened by a call to _IniOpenFileEx. ; Syntax.........: _IniCloseFileEx($hIniFile[, $iFlags]) ; Parameters ....: $hIniFile - Handle or INI Path to the INI file to be closed, This parameter can be NULL (use the $NULL_REF to set NULL this parameter) ; if $hIniFile is NULL Function Close All Open Handle or INI Path ; $iFlags - Optional, Flag to indicate the type of action that should be performed (add the flags together for multiple operations): ; |Default - always Commits the changes that were made when the INI file was opened by _IniOpenFileEx() ; |$INI_DISCARDCHANGES (134217728) - Discards the changes that were made when the INI file was opened by _IniOpenFileEx() ; Return values .: NONE ; Author ........: DXRW4E ; Remarks .......: ; =============================================================================================================================== Func _IniCloseFileEx($hIniFile, $iFlags = 0) If $hIniFile = $NULL_REF Then For $i = 1 To $_HINI[0][0] If Not BitAND($iFlags, $INI_DISCARDCHANGES) And $_HINI[$i][2] <> "FileQueue" Then _IniFileWriteEx($i, $iFlags) For $y = 0 To 10 $_HINI[$i][$y] = "" Next Next $_HINI[0][1] = 0 Else $hIniFile = _IniGetFileInformationEx($hIniFile) If @Error Then Return SetError(1, 0, 0) If Not BitAND($iFlags, $INI_DISCARDCHANGES) And $_HINI[$hIniFile][2] <> "FileQueue" Then _IniFileWriteEx($hIniFile, $iFlags) For $i = 0 To 10 $_HINI[$hIniFile][$i] = "" Next $_HINI[0][1] -= 1 EndIf Return 0 EndFunc ;==>_IniCloseFileEx ; #FUNCTION# ==================================================================================================================== ; Name...........: _IniDeleteEx ; Description ...: Delete\Remove - Section\KeyName in INI File. ; Syntax.........: _IniDeleteEx(ByRef $hIniFile, $sSectionName[, $sKeyName[, $iFlags[, $scKeyName]]]) ; Parameters ....: $hIniFile - Handle to the INI file to query "see _IniOpenFileEx()" ; $sSectionName - The name of the section containing the Key\Value, This parameter can be NULL (use the $NULL_REF to set NULL this parameter) ; If $sSectionName is NULL, $hIniFile must be contain Section String\Key\Value\Data and $sKeyName the name of the key to delete ; $sKeyName - The key name to delete, If $INI_OVERWRITEALL if set\used, $sKeyName will be writte exactly as in $sKeyName (without Edit\Formatting) ; This parameter can be NULL (use the $NULL_REF to set NULL this parameter), If $sKeyName is NULL, $hIniFile must be contain INI String\Text Data and $sSectionName the name of the section to delete ; $iFlags - Optional, Flag to indicate the type of action that should be performed (add the flags together for multiple operations): ; |$INI_NOOCCURRENCE (512) - Check only first section if there are more than one ; |$INI_IGNOREDUPLICATE (131072) - Proceed\Execute (Add\Delete\Replace\Edit ect ect) Once Only (Ignore all other Duplicate\Occurrences of KeyName\Value\Data) ; |$INI_DELETE (262144) - Delete\Remove KeyName\Value\Data ; |$INI_REMOVE (1048576) - Remove\Delete Section ; $scKeyName - Optional, Key-Name separator character, Default is '=', This parameter can not be '"' or @CR or @LF ; Return values .: Returns a 0 (check @Extended for number of edit performed) ; @Error - 0 = No error. ; |1 = Invalid IniHandle. ; |3 = SectionName not found ; Remarks .......: $INI_MERGE (1024) - (Join section if more than one in INI file) is always set\used by default, to disable it just use the $INI_NOOCCURRENCE ; Author ........: DXRW4E ; =============================================================================================================================== Func _IniDeleteEx(ByRef $hIniFile, $sSectionName, $sKeyName = "", $iFlags = 0, $scKeyName = "=") If Not $scKeyName Then $scKeyName = "=" If $sSectionName = $NULL_REF Then Local $iOffSet = StringInStr($hIniFile, @LF, 1) If StringRegExp(StringLeft($hIniFile, $iOffSet), '^(?i)[\h\f\xb\x0]*(?>\Q"' & $sKeyName & '"\E|\Q' & $sKeyName & '\E)[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*[^\n]*') Then If Not BitAND($iFlags, $INI_IGNOREDUPLICATE) Then $hIniFile = StringRegExpReplace($hIniFile, '\n[\h\f\xb\x0]*(?i)(?>\Q"' & $sKeyName & '"\E|\Q' & $sKeyName & '\E)[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*[^\n]*', "") $hIniFile = StringTrimLeft($hIniFile, $iOffSet) SetExtended(1) Else $hIniFile = StringRegExpReplace($hIniFile, '\n[\h\f\xb\x0]*(?i)(?>\Q"' & $sKeyName & '"\E|\Q' & $sKeyName & '\E)[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*[^\n]*', "", (BitAND($iFlags, $INI_IGNOREDUPLICATE) ? 1 : 0)) EndIf ElseIf $sKeyName = $NULL_REF Then ;Not Recommended (NOT SAFE), if the Section (contains) String\Text Data is greater than 4.5 MB, the Section will be ignored $hIniFile = StringTrimRight(StringRegExpReplace($hIniFile & @LF & "[", "(?is)\n[\h\f\xb\x0]*\[\Q" & StringReplace($sSectionName, "\E", "\e", 0, 1) & "\E\][^\n]*(?>\n?(?![\h\f\xb\x0]*\[))(.*?(?=\n[\h\f\xb\x0]*\[))", "", (BitAND($iFlags, $INI_IGNOREDUPLICATE) ? 1 : 0)), 2) Else If $hIniFile < 1 Or $hIniFile > $_HINI[0][0] Then Return SetError(1, 0, "") ;;;;If Not $sSectionName Then Return SetError(2, 0, "") ;Invalid Section Name If StringInStr($sSectionName, "\E", 1) Then $sSectionName = StringReplace($sSectionName, "\E", "\e", 0, 1) If Not $sKeyName Or BitAND($iFlags, $INI_REMOVE_DELETE) = $INI_REMOVE Then $iFlags = BitOr($iFlags, $INI_REMOVE) __IniWriteSectionEx($hIniFile, $sSectionName, $INI_NULL_REF, $iFlags, $INI_NULL_REF, $_HINI[$hIniFile][1]) Else $iFlags = BitOR(BitAND($iFlags, $INI_NOOCCURRENCE_IGNOREDUPLICATE), $INI_DELETE, $INI_MERGE) If $_HINI[$hIniFile][7] <> $sSectionName Or ($_HINI[$hIniFile][8] > 1 And BitAND($iFlags, $INI_MERGE_NOOCCURRENCE) <> BitAND($_HINI[$hIniFile][9], $INI_MERGE_NOOCCURRENCE)) Then __IniReadSectionEx($hIniFile, $sSectionName, $iFlags, $_HINI[$hIniFile][1]) If @Error Then Return SetError(3, 0, "") EndIf Local $aKeyValue[2][3] = [[1],[$sKeyName]] __IniWriteSectionEx($hIniFile, $sSectionName, $aKeyValue, $iFlags, $scKeyName, $_HINI[$hIniFile][1]) EndIf EndIf Return SetError(0, @Extended, 0) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _IniReadEx ; Description ...: The _IniReadEx Retrieves a string from the specified section in an Ini file ; Syntax.........: _IniReadEx($hIniFile, $sSectionName, $sKeyName[, $sDefault[, $iFlags[, $scKeyName]]]) ; Parameters ....: $hIniFile - Handle to the INI file to query "see _IniOpenFileEx()" ; $sSectionName - The name of the section containing the key name, This parameter can be NULL (use the $NULL_REF to set NULL this parameter) ; If $sSectionName is NULL, $hIniFile must be contain Section String\Key\Value\Data ; $sKeyName - The name of the key whose associated string is to be retrieved ; $sDefault - The default value to return if the requested KeyName is not found. ; $iFlags - Optional, Flag to indicate the type of action that should be performed (add the flags together for multiple operations): ; |$INI_ARRAYDATA (4) - Read All KeyName and Return Array of ValueString ; |$INI_ARRAYDATA_NOCOUNT (8) - Disable the return count in the first element, This Flags will be ignored if the $INI_ARRAYDATA is not set\used ; |$INI_NOOCCURRENCE (512) - Read only first section if there are more than one ; |$INI_MERGE (1024) - Join section if more than one in INI file, This Flag will be ignored if the $INI_NOOCCURRENCE is set\used ; $scKeyName - Optional, Key-Name separator character, Default is '=', This parameter can not be '"' or @CR or @LF ; Return values .: The first occurrence of requested key value as a string Or Array of Value String ; Failure - Returns $sDefault parameter ; @Error - 0 = No error. ; |1 = Invalid IniHandle. ; |3 = SectionName not found ; |5 = Invalid KeyName ; |6 = KeyName not found ; Remarks .......: ; Author ........: DXRW4E ; =============================================================================================================================== Func _IniReadEx(ByRef $hIniFile, $sSectionName, $sKeyName, $sDefault = "", $iFlags = 0, $scKeyName = "=") ;;If Not $sKeyName Then Return SetError(5, 0, "") If StringInStr($sKeyName, "\E", 1) Then $sKeyName = StringReplace($sKeyName, "\E", "\e", 0, 1) Local $aValueString, $sValueString, $iArray = BitAND($iFlags, $INI_ARRAYDATA) If $sSectionName = $NULL_REF Then $aValueString = StringRegExp(StringLeft($hIniFile, StringInStr($hIniFile, @LF, 1)), '^(?i)[\h\f\xb\x0]*(?>\Q"' & $sKeyName & '"\E|\Q' & $sKeyName & '\E)(?>[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*)(?|"([^\r\n]*)"|(.*?))[\h\f\xb\x0]*(?=[\r\n]|$)', 1) Else If $hIniFile < 1 Or $hIniFile > $_HINI[0][0] Then Return SetError(1, 0, "") If StringInStr($sSectionName, "\E", 1) Then $sSectionName = StringReplace($sSectionName, "\E", "\e", 0, 1) If $_HINI[$hIniFile][7] <> $sSectionName Or ($_HINI[$hIniFile][8] > 1 And BitAND($iFlags, $INI_MERGE_NOOCCURRENCE) <> BitAND($_HINI[$hIniFile][9], $INI_MERGE_NOOCCURRENCE)) Then _IniReadSectionEx($hIniFile, $sSectionName, BitOR($iFlags, $INI_STRIPLEADTRAILING)) If @Error Then Return SetError(3, 0, "") EndIf $aValueString = StringRegExp(StringLeft(($_HINI[$hIniFile][1])[$_HINI[$hIniFile][10]], StringInStr(($_HINI[$hIniFile][1])[$_HINI[$hIniFile][10]], @LF, 1)), '^(?i)[\h\f\xb\x0]*(?>\Q"' & $sKeyName & '"\E|\Q' & $sKeyName & '\E)(?>[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*)(?|"([^\r\n]*)"|(.*?))[\h\f\xb\x0]*(?=[\r\n]|$)', 1) ;;;;$aValueString = StringRegExp(($sSectionName = $NULL_REF ? $hIniFile : ($_HINI[$hIniFile][1])[$_HINI[$hIniFile][10]]), '(?im)^[\h\f\xb\x0]*(?>\Q"' & $sKeyName & '"\E|\Q' & $sKeyName & '\E)[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*(?|"([^\r\n]*)"|(.*?))[\h\f\xb\x0]*(?=[\r\n]|$)', 3) EndIf If Not @Error Then If Not $iArray Then Return $aValueString[0] $sValueString = $aValueString[0] & @LF EndIf $aValueString = StringRegExp(($sSectionName = $NULL_REF ? $hIniFile : ($_HINI[$hIniFile][1])[$_HINI[$hIniFile][10]]), '\n[\h\f\xb\x0]*(?i)(?>\Q"' & $sKeyName & '"\E|\Q' & $sKeyName & '\E)(?>[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*)(?|"([^\r\n]*)"|(.*?))[\h\f\xb\x0]*(?=[\r\n]|$)', ($iArray ? 3 : 1)) If @Error Then Return SetError(6, 0, $sDefault) If Not $iArray Then Return $aValueString[0] For $i = 0 To UBound($aValueString) - 1 $sValueString &= $aValueString[$i] & @LF Next Return StringSplit(StringTrimRight($sValueString, 1), @LF, (BitAND($iFlags, $INI_ARRAYDATA_NOCOUNT) ? 3 : 1)) EndFunc ;==>_IniReadEx ; #FUNCTION# ==================================================================================================================== ; Name...........: _IniReadSectionEx ; Description ...: The _IniReadSectionEx Retrieves all the lines for the specified section ; Syntax.........: _IniReadSectionEx(ByRef $hIniFile, $sSectionName[, $iFlags[, $scKeyName]) ; Parameters ....: $hIniFile - Handle to the INI file to query "see _IniOpenFileEx()" ; $sSectionName - The name of the section containing the Key\Value, This parameter can be NULL (use the $NULL_REF to set NULL this parameter) ; If $sSectionName is NULL, $hIniFile must be contain Section String\Key\Value\Data ; $iFlags - Optional, Flag to indicate the type of action that should be performed (add the flags together for multiple operations): ; Default Return Section String\Text Data ; |$INI_NOOCCURRENCE (512) - Read only first section if there are more than one ; |$INI_MERGE (1024) - Join section if more than one in INI file, This Flag will be ignored if the $INI_NOOCCURRENCE is set\used ; |$INI_2DARRAYFIELD (1073741824) - Return 2DArray ; $aArray[0][0] = number of elements ; $aArray[0][1] = Key-Name separator character, Defaut is '=' ; $aArray[1][0] = "KeyName" ; $aArray[1][1] = "Value" ; $aArray[1][2] = "Unmodified contents of a line (example ' KeyName = Value')" ; $aArray[n][0] = "KeyName" ; $aArray[n][1] = "Value" ; $aArray[n][2] = "Unmodified contents of a line (example ' KeyName = Value')" ; $scKeyName - Optional, Key-Name separator character, Default is '=', This parameter can not be '"' or @CR or @LF ; Return values .: String\Text Data Or 2D Array ; @Error - 0 = No error. ; |1 = Invalid IniHandle. ; |3 = SectionName's not found ; |4 = Array is invalid, Key\Value not found ; Remarks .......: ; Author ........: DXRW4E ; =============================================================================================================================== Func _IniReadSectionEx(ByRef $hIniFile, $sSectionName, $iFlags = 0, $scKeyName = "=") If Not $scKeyName Then $scKeyName = "=" If $sSectionName = $NULL_REF Then Local $_aSectionData = StringRegExp($hIniFile, '(?m)^((?>[\h\f\xb\x0]*)((?>"[^"\r\n]+"|(?:[^"\s' & $scKeyName & '\x0]+|(?>[\h\f\xb\x0]+)(?!' & $scKeyName & '))*))(?>[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*)(?|"([^\r\n]*)"|(.*?))[\h\f\xb\x0]*(?=[\r\n]|$))', 3) Else If $hIniFile < 1 Or $hIniFile > $_HINI[0][0] Then Return SetError(1, 0, "") If $_HINI[$hIniFile][7] <> $sSectionName Or ($_HINI[$hIniFile][8] > 1 And BitAND($iFlags, $INI_MERGE_NOOCCURRENCE) <> BitAND($_HINI[$hIniFile][9], $INI_MERGE_NOOCCURRENCE)) Then $iFlags = BitOR($iFlags, $INI_NOCREATE) __IniReadSectionEx($hIniFile, $sSectionName, $iFlags, $_HINI[$hIniFile][1]) If @Error Then Return SetError(3, 0, "") EndIf If Not BitAND($iFlags, $INI_2DARRAYFIELD) Then Return ($_HINI[$hIniFile][1])[$_HINI[$hIniFile][10]] Local $_aSectionData = StringRegExp(($_HINI[$hIniFile][1])[$_HINI[$hIniFile][10]], '(?m)^((?>[\h\f\xb\x0]*)((?>"[^"\r\n]+"|(?:[^"\s' & $scKeyName & '\x0]+|(?>[\h\f\xb\x0]+)(?!' & $scKeyName & '))*))(?>[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*)(?|"([^\r\n]*)"|(.*?))[\h\f\xb\x0]*(?=[\r\n]|$))', 3) EndIf If @Error Then Return SetError(4, 0, "") Local $iaSectionData = UBound($_aSectionData), $aSectionData[$iaSectionData / 3 + 1][3] = [[0,$scKeyName,$iaSectionData - 1]] For $i = 0 To $aSectionData[0][2] Step 3 $aSectionData[0][0] += 1 $aSectionData[$aSectionData[0][0]][0] = $_aSectionData[$i + 1] $aSectionData[$aSectionData[0][0]][1] = $_aSectionData[$i + 2] $aSectionData[$aSectionData[0][0]][2] = $_aSectionData[$i] Next Return SetError(0, $aSectionData[0][0], $aSectionData) EndFunc ;==>_IniReadSectionEx ; #FUNCTION# ==================================================================================================================== ; Name...........: _IniReadSectionNamesEx ; Description ...: The _IniReadSectionNamesEx Retrieves the names of all sections in an INI file ; Syntax.........: _IniReadSectionNamesEx($hIniFile[, $iFlags]) ; Parameters ....: $hIniFile - Handle to the INI file to query "see _IniOpenFileEx()" ; $iFlags - Optional, Flag to indicate the type of action that should be performed ; |$INI_ARRAYDATA_NOCOUNT (8) - disable the return count in the first element ; |$NULL_REF (NULL) - $hIniFile must be contain INI String\Section\Key\Value\Data ; Return values .: Array of SectionNames String, and set @Extended = Number of Section's ; @Error - 0 = No error. ; |1 = Array is invalid, Invalid IniHandle. ; |3 = Array is invalid, SectionName's not found ; Remarks .......: ; Author ........: DXRW4E ; =============================================================================================================================== Func _IniReadSectionNamesEx(ByRef $hIniFile, $iFlags = 0) If $iFlags = $NULL_REF Then Local $aSectionNames, $iANC = BitAND($iFlags, $INI_ARRAYDATA_NOCOUNT) $aSectionNames = StringRegExp(($iANC ? @LF : @LF & "[]" & @LF) & $hIniFile, "\n[\h\f\xb\x0]*\[([^\r\n]*)\]", 3) If @Error Then Return SetError(1, 0, "") If $iANC Then Return SetError(0, UBound($aSectionNames), $aSectionNames) $aSectionNames[0] = UBound($aSectionNames) - 1 Return SetError(0, $aSectionNames[0], $aSectionNames) EndIf If $hIniFile < 1 Or $hIniFile > $_HINI[0][0] Then Return SetError(1, 0, "") If Not $_HINI[$hIniFile][4] Then Return SetError(3, 0, "") If BitAND($iFlags, $INI_ARRAYDATA_NOCOUNT) Then Return SetError(0, $_HINI[$hIniFile][4], StringRegExp($_HINI[$hIniFile][5], "\n([^\r\n]*)", 3)) Return SetError(0, $_HINI[$hIniFile][4], StringRegExp(@LF & $_HINI[$hIniFile][4] & $_HINI[$hIniFile][5], "\n([^\r\n]*)", 3)) EndFunc ;==>_IniReadSectionNamesEx ; #FUNCTION# ==================================================================================================================== ; Name...........: _IniRenameSectionEx ; Description ...: The _IniRenameSectionEx rename the sections in an INI file ; Syntax.........: _IniRenameSectionEx($hIniFile[, $iFlags]) ; Parameters ....: $hIniFile - Handle to the INI file to query "see _IniOpenFileEx()" ; $iFlags - Optional, Flag to indicate the type of action that should be performed (add the flags together for multiple operations): ; |$INI_NOOCCURRENCE (512) - Rename only first section if there are more than one ; |$INI_MERGE (1024) - Join section if more than one in INI\INI file, This Flag will be ignored if the $INI_NOOCCURRENCE is set\used ; |$NULL_REF (NULL) - $hIniFile must be contain INI String\Section\Key\Value\Data ; Return values .: Returns a 0 (check @Extended for number of edit performed) ; @Error - 0 = No error. ; |1 = Invalid IniHandle. ; |3 = SectionName's not found ; Remarks .......: ; Author ........: DXRW4E ; =============================================================================================================================== Func _IniRenameSectionEx(ByRef $hIniFile, $sSectionName, $sNewSectionName, $iFlags = 0) ;;;;If Not $sSectionName Or Not $sNewSectionName Then Return SetError(2, 0, "") ;Invalid Section Name If $iFlags = $NULL_REF Then $hIniFile = StringRegExpReplace($hIniFile, "(?mi)^[\h\f\xb\x0]*\[\K\Q" & StringReplace($sSectionName, "\E", "\e", 0, 1) & "\E(?=\])", StringReplace($sNewSectionName, "\", "\\", 0, 1), (BitAND($iFlags, $INI_NOOCCURRENCE) ? 1 : 0)) Else If $hIniFile < 1 Or $hIniFile > $_HINI[0][0] Then Return SetError(1, 0, "") If StringInStr($sSectionName, "\E", 1) Then $sSectionName = StringReplace($sSectionName, "\E", "\e", 0, 1) $iFlags = BitXOR(BitOR($iFlags, $INI_REMOVE_RENAME), $INI_REMOVE) If BitAND($iFlags, $INI_MERGE_NOOCCURRENCE) = $INI_MERGE And Not __IniReadSectionEx($hIniFile, $sSectionName, $iFlags, $_HINI[$hIniFile][1]) Then Return SetError(3, 0, 0) __IniWriteSectionEx($hIniFile, $sSectionName, $sNewSectionName, $iFlags, $INI_NULL_REF, $_HINI[$hIniFile][1]) EndIf Return SetError(@Error, @Extended, 0) EndFunc ;==>_IniRenameSectionEx ; #FUNCTION# ==================================================================================================================== ; Name...........: _IniWriteEx ; Description ...: Write\Add\Replace\Delete\Change\Edit a KeyName\Value\Data in INI File ; Syntax.........: _IniWriteEx(ByRef $hIniFile, $sSectionName, $sKeyName, $sValue[, $iFlags[, $scKeyName]]) ; Parameters ....: $hIniFile - Handle to the INI file to query "see _IniOpenFileEx()" ; $sSectionName - The name of the section containing the Key\Value, This parameter can be NULL (use the $NULL_REF to set NULL this parameter) ; If $sSectionName is NULL, $hIniFile must be contain Section String\Key\Value\Data ; $sKeyName - The key name in the in the .ini file. ; $sKeyName - The value to write/change. ; $iFlags - Optional, Flag to indicate the type of action that should be performed (add the flags together for multiple operations): ; |$INI_STRIPLEADING (1) - strip leading white space Section, This Flag will be ignored if the $INI_OVERWRITEALL or $INI_APPENDDATA is set\used ; |$INI_STRIPTRAILING (2) - trailing white space Section, This Flag will be ignored if the $INI_OVERWRITEALL or $INI_APPENDDATA is set\used ; |$INI_NOOCCURRENCE (512) - Check only first section if there are more than one ; |$INI_NOCREATE (2048) - Not Create New Section If Section Not Exist ; |$INI_APPENDDATA (4096) - Add KeyName\Value\Data (Append Mod) ; |$INI_REPLACEONLY (8192) - Add KeyName\Value\Data Only if Exist ; |$INI_NOOVERWRITE (32768) - Add KeyName\Value\Data Only if Not Exist ; |$INI_OVERWRITEALL (65536) - Overwrite All data in Section (Replaces all KeyName\Value\Data in the Section) ; |$INI_IGNOREDUPLICATE (131072) - Proceed\Execute (Add\Delete\Replace\Edit ect ect) Once Only (Ignore all other Duplicate\Occurrences of KeyName\Value\Data) ; |$INI_DELETE (262144) - Delete\Remove KeyName\Value\Data ; $scKeyName - Optional, Key-Name separator character, Default is '=', This parameter can not be '"' or @CR or @LF ; Return values .: Returns a 0 (check @Extended for number of edit performed) ; @Error - 0 = No error. ; |1 = Invalid IniHandle. ; |3 = SectionName's not found ; |5 = Invalid KeyName ; Author ........: DXRW4E ; Remarks .......: $INI_MERGE (1024) - (Join section if more than one in INI file) is always set\used by default, to disable it just use the $INI_NOOCCURRENCE ; =============================================================================================================================== Func _IniWriteEx(ByRef $hIniFile, $sSectionName, $sKeyName, $sValue, $iFlags = 0, $scKeyName = "=") ;;If Not $sKeyName Then Return SetError(5, 0, "") If Not $scKeyName Then $scKeyName = "=" If $sSectionName = $NULL_REF Then If BitAND($iFlags, $INI_OVERWRITEALL_APPENDDATA) Then If BitAND($iFlags, $INI_OVERWRITEALL) Then $hIniFile = "" $hIniFile &= $sKeyName & $scKeyName & $sValue & @CRLF Else Local $asKeyValue, $sKNPattern, $iOffSet = StringInStr($hIniFile, @LF, 1) $sKNPattern = '\n[\h\f\xb\x0]*(?i)(?>\Q"' & $sKeyName & '"\E|\Q' & $sKeyName & '\E)[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*[^\n]*' If StringRegExp(StringLeft($hIniFile, $iOffSet), '^(?i)[\h\f\xb\x0]*(?>\Q"' & $sKeyName & '"\E|\Q' & $sKeyName & '\E)[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*[^\n]*') Then If Not BitAND($iFlags, $INI_IGNOREDUPLICATE) Then $hIniFile = StringRegExpReplace($hIniFile, $sKNPattern, "") If BitAND($iFlags, $INI_DELETE) Then $hIniFile = StringTrimLeft($hIniFile, $iOffSet) ElseIf Not BitAND($iFlags, $INI_NOOVERWRITE) Then $hIniFile = $sKeyName & $scKeyName & $sValue & @CRLF & StringTrimLeft($hIniFile, $iOffSet) EndIf ElseIf BitAND($iFlags, $INI_DELETE) Then $hIniFile = StringRegExpReplace($hIniFile, $sKNPattern, "", (BitAND($iFlags, $INI_IGNOREDUPLICATE) ? 1 : 0)) Else $asKeyValue = StringRegExp($hIniFile, $sKNPattern, 1) $iOffSet = @Extended - 1 If Not @Error Then If BitAND($iFlags, $INI_NOOVERWRITE) Then If Not BitAND($iFlags, $INI_IGNOREDUPLICATE) Then $hIniFile = StringLeft($hIniFile, $iOffSet) & StringRegExpReplace(StringTrimLeft($hIniFile, $iOffSet), $sKNPattern, "") Else $hIniFile = StringLeft($hIniFile, $iOffSet + 1 - StringLen($asKeyValue[0])) & $sKeyName & $scKeyName & $sValue & @CR & (BitAND($iFlags, $INI_IGNOREDUPLICATE) ? StringTrimLeft($hIniFile, $iOffSet) : StringRegExpReplace(StringTrimLeft($hIniFile, $iOffSet), $sKNPattern, "")) EndIf ElseIf Not BitAND($iFlags, $INI_REPLACEONLY) Then $hIniFile &= $sKeyName & $scKeyName & $sValue & @CRLF Else Return SetError(0, 0, 0) EndIf EndIf EndIf Return SetError(0, 1, 0) Else If $hIniFile < 1 Or $hIniFile > $_HINI[0][0] Then Return SetError(1, 0, "") ;;;;If Not $sSectionName Then Return SetError(2, 0, "") ;Invalid Section Name If StringInStr($sSectionName, "\E", 1) Then $sSectionName = StringReplace($sSectionName, "\E", "\e", 0, 1) Local $aKeyValue[2][3] = [[1],[$sKeyName,"",$sKeyName & $scKeyName & $sValue]] $iFlags = BitOR(BitXOR($iFlags, BitAND($iFlags, $INI_REMOVE_RENAME)), $INI_MERGE) If $_HINI[$hIniFile][7] <> $sSectionName Or ($_HINI[$hIniFile][8] > 1 And BitAND($iFlags, $INI_MERGE_NOOCCURRENCE) <> BitAND($_HINI[$hIniFile][9], $INI_MERGE_NOOCCURRENCE)) Then __IniReadSectionEx($hIniFile, $sSectionName, $iFlags, $_HINI[$hIniFile][1]) If @Error Then Return SetError(3, 0, "") EndIf __IniWriteSectionEx($hIniFile, $sSectionName, $aKeyValue, $iFlags, $scKeyName, $_HINI[$hIniFile][1]) EndIf Return SetError(@Error, @Extended, 0) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _IniWriteSectionEx ; Description ...: Add\Replace\Delete\Remove\Rename\Change\Edit a Section\KeyName\Value\Data in INI File. ; Syntax.........: _IniWriteSectionEx() ; Parameters ....: $hIniFile - Handle to the INI file to query "see _IniOpenFileEx()" ; $sSectionName - The name of the section containing the Key\Value\Data ; $aKeyValue - String\Text Data (example 'KeyName=Value 7 @LF & KeyName2=Value2') or an 2DArray is passed as data, the return Array of IniReadSectionEx() can be used immediately. ; If $aKeyValue is String\Text Data and $INI_OVERWRITEALL or $INI_APPENDDATA if Set\Used, $aKeyValue will be writte exactly as in $aKeyValue (without Edit\Formatting) ; $iFlags - Optional, Flag to indicate the type of action that should be performed (add the flags together for multiple operations): ; |$INI_STRIPLEADING (1) - strip leading white space Section, This Flag will be ignored if the $INI_OVERWRITEALL or $INI_APPENDDATA is set\used ; |$INI_STRIPTRAILING (2) - trailing white space Section, This Flag will be ignored if the $INI_OVERWRITEALL or $INI_APPENDDATA is set\used ; |$INI_NOOCCURRENCE (512) - Check only first section if there are more than one ; |$INI_NOCREATE (2048) - Not Create New Section If Section Not Exist ; |$INI_APPENDDATA (4096) - Add KeyName\Value\Data (Append Mod) ; |$INI_REPLACEONLY (8192) - Add KeyName\Value\Data Only if Exist ; |$INI_NOOVERWRITE (32768) - Add KeyName\Value\Data Only if Not Exist ; |$INI_OVERWRITEALL (65536) - Overwrite All data in Section (Replaces all KeyName\Value\Data in the Section) ; |$INI_IGNOREDUPLICATE (131072) - Proceed\Execute (Add\Delete\Replace\Edit ect ect) Once Only (Ignore all other Duplicate\Occurrences of KeyName\Value\Data) ; |$INI_DELETE (262144) - Delete\Remove KeyName\Value\Data ; |$INI_RENAME (524288) - Renames a section ; |$INI_REMOVE (1048576) - Remove\Delete Section ; $scKeyName - Optional, Key-Name separator character, Default is '=', This parameter can not be '"' or @CR or @LF ; Return values .: Returns a 0 (check @Extended for number of edit performed) ; @Error - 0 = No error. ; |1 = Invalid IniHandle. ; |3 = SectionName's not found ; |5 = Invalid KeyName ; Remarks .......: ; Author ........: DXRW4E ; Remarks .......: $INI_MERGE (1024) - (Join section if more than one in INI file) is always set\used by default, to disable it just use the $INI_NOOCCURRENCE ; =============================================================================================================================== Func _IniWriteSectionEx(ByRef $hIniFile, $sSectionName, $aKeyValue, $iFlags = 0, $scKeyName = "=") ;~ If $sSectionName = $NULL_REF Then ;~ If Not $scKeyName Then $scKeyName = "=" ;~ If IsArray($aKeyValue) Then ;~ Local $iCols = UBound($aKeyValue, 2) ;~ If UBound($aKeyValue, 0) <> 2 Or $iCols < 2 Then Return SetError(7, 0, "") ;~ If $iCols = 2 Then ;~ ReDim $aKeyValue[$aKeyValue[0][0] + 1][3] ;~ For $i = 1 To $aKeyValue[0][0] ;~ $aKeyValue[$i][2] = $aKeyValue[$i][0] & $scKeyName & $aKeyValue[$i][1] ;~ Next ;~ EndIf ;~ ElseIf Not BitAND($iFlags, $INI_OVERWRITEALL_APPENDDATA) Then ;~ $aKeyValue = _IniReadSectionEx($aKeyValue, Null, $INI_2DARRAYFIELD, $scKeyName) ;~ If @Error Then Return SetError(7, 0, "") ;~ EndIf ;~ If BitAND($iFlags, $INI_OVERWRITEALL_APPENDDATA) Then ;~ If BitAND($iFlags, $INI_OVERWRITEALL) Then $hIniFile = "" ;~ If IsArray($aKeyValue) Then ;~ For $i = 1 To $aKeyValue[0][0] ;~ $hIniFile &= $aKeyValue[$i][2] & @CRLF ;~ Next ;~ Else ;~ ;; KeyName\Value\Text Data will be writte exactly as in $aKeyValue (without Edit\Formatting ect ect) ;~ $hIniFile &= $aKeyValue & (StringRight($aKeyValue, 1) = @LF ? "" : @CRLF) ;~ EndIf ;~ Return SetError(0, 1, 0) ;~ Else ;~ Local $asKeyValue, $iKeyValue = 0, $sKNPattern, $iOffSet = StringInStr($hIniFile, @LF, 1) ;~ For $i = 1 To $aKeyValue[0][0] ;~ $sKNPattern = '\n[\h\f\xb\x0]*(?i)(?>\Q"' & $aKeyValue[$i][0] & '"\E|\Q' & $aKeyValue[$i][0] & '\E)[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*[^\n]*' ;~ If StringRegExp(StringLeft($hIniFile, $iOffSet), '^(?i)[\h\f\xb\x0]*(?>\Q"' & $aKeyValue[$i][0] & '"\E|\Q' & $aKeyValue[$i][0] & '\E)[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*[^\n]*') Then ;~ If Not BitAND($iFlags, $INI_IGNOREDUPLICATE) Then $hIniFile = StringRegExpReplace($hIniFile, $sKNPattern, "") ;~ If BitAND($iFlags, $INI_DELETE) Then ;~ $hIniFile = StringTrimLeft($hIniFile, $iOffSet) ;~ ElseIf Not BitAND($iFlags, $INI_NOOVERWRITE) Then ;~ $hIniFile = $aKeyValue[$i][2] & @CRLF & StringTrimLeft($hIniFile, $iOffSet) ;~ EndIf ;~ ElseIf BitAND($iFlags, $INI_DELETE) Then ;~ $hIniFile = StringRegExpReplace($hIniFile, $sKNPattern, "", (BitAND($iFlags, $INI_IGNOREDUPLICATE) ? 1 : 0)) ;~ Else ;~ $asKeyValue = StringRegExp($hIniFile, $sKNPattern, 1) ;~ $iOffSet = @Extended - 1 ;~ If Not @Error Then ;~ If BitAND($iFlags, $INI_NOOVERWRITE) Then ;~ If Not BitAND($iFlags, $INI_IGNOREDUPLICATE) Then $hIniFile = StringLeft($hIniFile, $iOffSet) & StringRegExpReplace(StringTrimLeft($hIniFile, $iOffSet), $sKNPattern, "") ;~ Else ;~ $hIniFile = StringLeft($hIniFile, $iOffSet + 1 - StringLen($asKeyValue[0])) & $aKeyValue[$i][2] & @CR & (BitAND($iFlags, $INI_IGNOREDUPLICATE) ? StringTrimLeft($hIniFile, $iOffSet) : StringRegExpReplace(StringTrimLeft($hIniFile, $iOffSet), $sKNPattern, "")) ;~ EndIf ;~ ElseIf Not BitAND($iFlags, $INI_REPLACEONLY) Then ;~ $hIniFile &= $aKeyValue[$i][2] & @CRLF ;~ Else ;~ $iKeyValue -= 1 ;~ EndIf ;~ EndIf ;~ $iKeyValue += 1 ;~ Next ;~ Return SetError(0, $iKeyValue, 0) ;~ EndIf ;~ EndIf If $hIniFile < 1 Or $hIniFile > $_HINI[0][0] Then Return SetError(1, 0, "") ;;;;If Not $sSectionName Then Return SetError(2, 0, "") ;Invalid Section Name If StringInStr($sSectionName, "\E", 1) Then $sSectionName = StringReplace($sSectionName, "\E", "\e", 0, 1) If BitAND($iFlags, $INI_REMOVE) Then __IniWriteSectionEx($hIniFile, $sSectionName, $INI_NULL_REF, $iFlags, $INI_NULL_REF, $_HINI[$hIniFile][1]) ElseIf BitAND($iFlags, $INI_RENAME) Then ;;;; $aKeyValue is New Section Name ;;If Not $aKeyValue Then Return SetError(5, 0, "") If BitAND($iFlags, $INI_MERGE_NOOCCURRENCE) = $INI_MERGE And Not __IniReadSectionEx($hIniFile, $sSectionName, $iFlags, $_HINI[$hIniFile][1]) Then Return SetError(3, 0, 0) __IniWriteSectionEx($hIniFile, $sSectionName, $aKeyValue, $iFlags, $INI_NULL_REF, $_HINI[$hIniFile][1]) Else If Not $scKeyName Then $scKeyName = "=" If IsArray($aKeyValue) Then Local $iCols = UBound($aKeyValue, 2) If UBound($aKeyValue, 0) <> 2 Or $iCols < 2 Then Return SetError(5, 0, "") If $iCols = 2 Then ReDim $aKeyValue[$aKeyValue[0][0] + 1][3] For $i = 1 To $aKeyValue[0][0] $aKeyValue[$i][2] = $aKeyValue[$i][0] & $scKeyName & $aKeyValue[$i][1] Next EndIf ElseIf Not BitAND($iFlags, $INI_OVERWRITEALL_APPENDDATA) Then $aKeyValue = _IniReadSectionEx($aKeyValue, Null, $INI_2DARRAYFIELD, $scKeyName) If @Error Then Return SetError(5, 0, "") EndIf $iFlags = BitOR($iFlags, $INI_MERGE) If $_HINI[$hIniFile][7] <> $sSectionName Or ($_HINI[$hIniFile][8] > 1 And BitAND($iFlags, $INI_MERGE_NOOCCURRENCE) <> BitAND($_HINI[$hIniFile][9], $INI_MERGE_NOOCCURRENCE)) Then __IniReadSectionEx($hIniFile, $sSectionName, $iFlags, $_HINI[$hIniFile][1]) If @Error Then Return SetError(3, 0, "") EndIf __IniWriteSectionEx($hIniFile, $sSectionName, $aKeyValue, $iFlags, $scKeyName, $_HINI[$hIniFile][1]) EndIf Return SetError(@Error, @Extended, 0) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _IniGetSectionNumberEx ; Description ...: The _IniGetSectionNumberEx Retrieves the number of all sections in an INI file ; Syntax.........: _IniGetSectionNumberEx(Byref $hIniFile) ; Parameters ....: $hIniFile - Handle to the INI file to query "see _IniOpenFileEx()" ; Return values .: Number of Section's ; @Error - 0 = No error. ; |1 = Invalid IniHandle. ; |3 = SectionName's not found ; Remarks .......: ; Author ........: DXRW4E ; =============================================================================================================================== Func _IniGetSectionNumberEx(ByRef $hIniFile) If $hIniFile < 1 Or $hIniFile > $_HINI[0][0] Then Local $aSectionNames = StringRegExp(@LF & $hIniFile, "\n[\h\f\xb\x0]*\[[^\r\n]*\K\]", 3) ;StringRegExp($hIniFile, "(?m)^[\h\f\xb\x0]*\[[^\r\n]*\]", 3) Return SetError(@Error, 0, UBound($aSectionNames)) EndIf Return SetError(($_HINI[$hIniFile][4] ? 0 : 3), 0, $_HINI[$hIniFile][4]) EndFunc ;==>_IniGetSectionNumberEx ; #FUNCTION# =========================================================================================================== ; Name...........: _IniGetFileInformationEx ; Description ...: Returns information about an INI file ; Syntax.........: _IniGetFileInformationEx($hIniFile[, $iFlags]) ; Parameters ....: $hIniFile - Handle of INI file previously opened by _IniOpenFileEx, see _IniOpenFileEx() ; $iFlags - Optional ; |0 - Return INI Handle (Default) ; |1 - Return INI File Array Data (is array of arrays) ; |2 - Return INI File Path ; |3 - Return INI Encoding ; |4 - Return INI Section Number ; Return values .: See Flag parameter ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: ; =============================================================================================================================== Func _IniGetFileInformationEx($hIniFile, $iFlags = 0) If Not $hIniFile Then Return SetError(1, 0, "") If $_HINI[0][1] < 0 Then $_HINI[0][1] = 0 Return SetError(1, 0, "") ElseIf IsString($hIniFile) Then ;;If StringIsDigit($hIniFile) And StringLeft($hIniFile, 1) <> "0" Then ;; $hIniFile = Number($hIniFile) ;;Else For $i = 1 To $_HINI[0][0] If $_HINI[$i][2] = $hIniFile Then ExitLoop Next $hIniFile = $i ;;EndIf EndIf If $hIniFile < 1 Or $hIniFile > $_HINI[0][0] Then Return SetError(1, 0, "") ; Or $hIniFile <> $_HINI[$hIniFile][0] If $iFlags < 1 Or $iFlags > 4 Then Return $hIniFile Return SetError(0, $hIniFile, $_HINI[$hIniFile][$iFlags]) EndFunc ;==>_IniGetFileInformationEx ; #FUNCTION# ==================================================================================================================== ; Name...........: _IniGetFileStringData ; Description ...: The _IniGetFileStringData Retrieves all INI Lines\String\Text Data ; Syntax.........: _IniGetFileStringData(ByRef $hIniFile[, $iFlags]) ; Parameters ....: $hIniFile - Handle to the INI file to query "see _IniOpenFileEx()" ; $iFlags - Optional, Flag to indicate the type of action that should be performed (add the flags together for multiple operations): ; |$INI_STRIPLEADING (1) - strip leading white space Section ; |$INI_STRIPTRAILING (2) - strip trailing white space Section ; Return values .: String\Text Data ; @Error - 0 = No error. ; |1 = Invalid IniHandle. ; Remarks .......: ; Author ........: DXRW4E ; =============================================================================================================================== Func _IniGetFileStringData(ByRef $hIniFile, $iFlags = 0) If $hIniFile < 1 Or $hIniFile > $_HINI[0][0] Then Return SetError(1, 0, "") ;;Local $sData, $iSL = BitAND($iFlags, $INI_STRIPLEADING), $iST = BitAND($iFlags, $INI_STRIPTRAILING) ;;$sData = ($iSL ? "" : ($_HINI[$hIniFile][1])[3]) & ($_HINI[$hIniFile][1])[4] & ($iST ? "" : ($_HINI[$hIniFile][1])[5]) ;;For $i = 6 To ($_HINI[$hIniFile][1])[0] Step 6 ;; $sData &= ($_HINI[$hIniFile][1])[$i] & ($_HINI[$hIniFile][1])[$i + 1] & ($_HINI[$hIniFile][1])[$i + 2] & ($iSL ? "" : ($_HINI[$hIniFile][1])[$i + 3]) & ($_HINI[$hIniFile][1])[$i + 4] & ($iST ? "" : ($_HINI[$hIniFile][1])[$i + 5]) ;;Next Local $sData = __IniGetFileStringData($hIniFile, $iFlags, $_HINI[$hIniFile][1]) Return SetError(0, $_HINI[$hIniFile][3], $sData) EndFunc ;==>_IniGetFileStringData ; #FUNCTION# ==================================================================================================================== ; Name...........: _IniClearCache ; Description ...: Clear INI File Processing Functions Cache ; Syntax.........: _IniClearCache(ByRef $aIniFile) ; Parameters ....: $hIniFile - Handle to the INI file to query "see _IniOpenFileEx()" ; Return values .: None ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: This function is useful to Run after _IniRea*Ex Funcion's, only in the case when in the INI file are duplicated function ; and if the flag $INI_MERGE or $INI_NOOCCURRENCE is not set\used, because in this case the _IniReadEx\_IniReadSectionEx saves ; in cache the Function's\String\Data to be fast during the loop ect ect, so only in cases when you Get\Read Occurrence Function ; and the flag $INI_MERGE or $INI_NOOCCURRENCE is not set\used ; All other function as _IniDeleteEx or _IniWrite*Ex use by Default or Force the use of $INI_MERGE flag ; So in 99.9% of cases you do not Need\Have to run _IniClearCache(), because the INI File Processing Functions Work's only By Reference ; =============================================================================================================================== Func _IniClearCache(ByRef $hIniFile) If $hIniFile < 1 Or $hIniFile > $_HINI[0][0] Then Return SetError(1, 0, "") $_HINI[$hIniFile][6] = "" __IniSaveCache($hIniFile, $_HINI[$hIniFile][6], $INI_NULL_REF, $_HINI[$hIniFile][6], $_HINI[$hIniFile][6], $_HINI[$hIniFile][1]) Return 0 EndFunc ;==>_IniClearCache ; #FUNCTION# ==================================================================================================================== ; Name...........: _IniFileWrite ; Description ...: Write a Ini File ; Syntax.........: _IniFileWriteEx(ByRef $hIniFile[, $iFlags[, $sFilePath[, $iFileEncoding]]]) ; Parameters ....: $hIniFile - Handle to the INI file to query "see _IniOpenFileEx()" ; $iFlags - Optional, Flag to indicate the type of action that should be performed (add the flags together for multiple operations): ; |$INI_STRIPLEADING (1) - strip leading white space Section ; |$INI_STRIPTRAILING (2) - trailing white space Section ; |$INI_NOWRITEREADONLY (16) - Do not Write\Replace\Edit the ReadOnly file (Default Write\Replace\Edit the ReadOnly files) ; $sFilePath - Optional, use alternative FilePath, By Default always is used (Default) PathFile ; $iFileEncoding - Optional, use alternative FileEncoding, By Default always is used (Default) FileEncoding ; Return values .: Returns a 0 ; @Error - 0 = No error. ; |1 = Invalid IniHandle. ; |9 = Invalid FilePath ; |10 = A file may fail to open due to access rights or attributes. ; Remarks .......: ; Author ........: DXRW4E ; =============================================================================================================================== Func _IniFileWriteEx(ByRef $hIniFile, $iFlags = 0, $sFilePath = Default, $iFileEncoding = Default) If $hIniFile < 1 Or $hIniFile > $_HINI[0][0] Then Return SetError(1, 0, "") If $_HINI[$hIniFile][2] = "FileQueue" And Not $sFilePath Then Return SetError(9, 0, "") If $sFilePath = Default Then $sFilePath = $_HINI[$hIniFile][2] If $iFileEncoding = Default Then $iFileEncoding = $_HINI[$hIniFile][3] + 10 ;;Local $hFileOpen, $iSL = BitAND($iFlags, $INI_STRIPLEADING), $iST = BitAND($iFlags, $INI_STRIPTRAILING) ;;$hFileOpen = FileOpen($_HINI[$hIniFile][2], $_HINI[$hIniFile][3] + 10) ;; ;; Check if file opened for writing OK ;;If $hFileOpen = -1 Then ;; Return SetError(10, 0, 0) ;;EndIf ;;FileWrite($hFileOpen, ($iSL ? "" : ($_HINI[$hIniFile][1])[3]) & ($_HINI[$hIniFile][1])[4] & ($iST ? "" : ($_HINI[$hIniFile][1])[5])) ;;For $i = 6 To ($_HINI[$hIniFile][1])[0] Step 6 ;; FileWrite($hFileOpen, ($_HINI[$hIniFile][1])[$i] & ($_HINI[$hIniFile][1])[$i + 1] & ($_HINI[$hIniFile][1])[$i + 2] & ($iSL ? "" : ($_HINI[$hIniFile][1])[$i + 3]) & ($_HINI[$hIniFile][1])[$i + 4] & ($iST ? "" : ($_HINI[$hIniFile][1])[$i + 5])) ;;Next ;;FileClose($hFileOpen) __IniFileWriteEx($hIniFile, $iFlags, $sFilePath, $iFileEncoding, $_HINI[$hIniFile][1]) Return SetError(@Error, @Extended, 0) EndFunc ;==>_IniFileWriteEx ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name...........: __IniReadSectionEx ; Description ...: Support Function for _IniReadSectionEx ; Syntax.........: __IniReadSectionEx(ByRef $aIniFile, ByRef $sSectionName, ByRef $iFlags) ; Parameters ....: See _IniReadSectionEx() ; Return values .: See _IniReadSectionEx() ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: This function is used internally by _IniReadSectionEx ; =============================================================================================================================== Func __IniReadSectionEx(ByRef $hIniFile, ByRef $sSectionName, ByRef $iFlags, ByRef $aIniFile) ;;;;If Not $sSectionName Then Return SetError(2, 0, "") ;Invalid Section Name If StringInStr($sSectionName, "\E", 1) Then $sSectionName = StringReplace($sSectionName, "\E", "\e", 0, 1) Local $sSectionData, $aSectionName, $iSectionName = 1 $aSectionName = StringRegExp($_HINI[$hIniFile][5], "\n(?is)\Q" & $sSectionName & "\E\r([^\n]+)", 3) If @Error Then If BitAND($iFlags, $INI_NOCREATE_REMOVE_DELETE) Then Return SetError(3, 0, "") $aIniFile[0] += 6 Redim $aIniFile[$aIniFile[0] + 1] $aIniFile[$aIniFile[0] - 5] = "[" $aIniFile[$aIniFile[0] - 4] = $sSectionName $aIniFile[$aIniFile[0] - 3] = "]" & @CRLF $_HINI[$hIniFile][4] += 1 $_HINI[$hIniFile][5] &= @LF & $sSectionName & @CR & ($aIniFile[0] - 4) $_HINI[$hIniFile][6] = $aIniFile[0] - 1 Else $_HINI[$hIniFile][6] = $aSectionName[0] + 3 $iSectionName = UBound($aSectionName) ;;If BitAND($iFlags, $INI_STRIPLEADTRAILING) = $INI_STRIPLEADTRAILING Then ;; BitOR($INI_STRIPLEADING, $INI_STRIPTRAILING) ;; $sSectionData = $aIniFile[$aSectionName[0] + 3] ;;ElseIf BitAND($iFlags, $INI_STRIPLEADING) Then ;; $sSectionData = $aIniFile[$aSectionName[0] + 3] & $aIniFile[$aSectionName[0] + 4] ;;ElseIf BitAND($iFlags, $INI_STRIPTRAILING) Then ;; $sSectionData = $aIniFile[$aSectionName[0] + 2] & $aIniFile[$aSectionName[0] + 3] ;;Else ;; $sSectionData = $aIniFile[$aSectionName[0] + 2] & $aIniFile[$aSectionName[0] + 3] & $aIniFile[$aSectionName[0] + 4] ;;EndIf If Not BitAND($iFlags, $INI_NOOCCURRENCE) And $iSectionName > 1 Then $sSectionData = $aIniFile[$aSectionName[0] + 3] For $i = 1 To $iSectionName - 1 $sSectionData &= $aIniFile[$aSectionName[$i] + 3] If BitAND($iFlags, $INI_MERGE) Then For $y = $aSectionName[$i] - 1 To $aSectionName[$i] + 4 $aIniFile[$y] = "" Next $_HINI[$hIniFile][5] = StringRegExpReplace($_HINI[$hIniFile][5], '\n(?is)\Q' & $sSectionName & '\E\r' & $aSectionName[$i], "") EndIf Next If BitAND($iFlags, $INI_MERGE) Then $aIniFile[$aSectionName[0] + 3] = $sSectionData EndIf EndIf __IniSaveCache($hIniFile, $sSectionData, $sSectionName, $iFlags, $iSectionName, $aIniFile) Return $iSectionName ;SetError(Not $iSectionName, $iSectionName, $sSectionData) EndFunc ;==>__IniReadSectionEx ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name...........: __IniWriteSectionEx ; Description ...: Support Function for _IniWriteSectionEx ; Syntax.........: __IniWriteSectionEx(ByRef $hIniFile, ByRef $sSectionName, ByRef $aKeyValue, ByRef $iFlags, ByRef $scKeyName, ByRef $aIniFile) ; Parameters ....: See _IniWriteSectionEx() ; Return values .: See _IniWriteSectionEx() ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: This function is used internally by _IniWriteSectionEx ; =============================================================================================================================== Func __IniWriteSectionEx(ByRef $hIniFile, ByRef $sSectionName, ByRef $aKeyValue, ByRef $iFlags, ByRef $scKeyName, ByRef $aIniFile) If BitAND($iFlags, $INI_REMOVE) Then Local $iaSectionName, $aSectionName = StringRegExp($_HINI[$hIniFile][5], '\n(?is)\Q' & $sSectionName & '\E\r([^\n]+)', 3) If @Error Then Return SetError(3, 0, 0) $iaSectionName = UBound($aSectionName) - 1 If BitAND($iFlags, $INI_NOOCCURRENCE) Then $iaSectionName = 0 For $i = 0 To $iaSectionName For $y = $aSectionName[$i] - 1 To $aSectionName[$i] + 4 $aIniFile[$y] = "" Next Next $_HINI[$hIniFile][4] -= $iaSectionName + 1 $_HINI[$hIniFile][5] = StringRegExpReplace($_HINI[$hIniFile][5], '\n(?is)\Q' & $sSectionName & '\E\r[^\r\n]+', "", Int($iaSectionName = 0)) Return SetError(0, @Extended, 0) ElseIf BitAND($iFlags, $INI_RENAME) Then Local $iaSectionName, $aSectionName = StringRegExp($_HINI[$hIniFile][5], '\n(?is)\Q' & $sSectionName & '\E\r([^\n]+)', 3) If @Error Then Return SetError(3, 0, 0) $iaSectionName = UBound($aSectionName) - 1 If BitAND($iFlags, $INI_NOOCCURRENCE) Then $iaSectionName = 0 ;; $aKeyValue is New Section Name For $i = 0 To $iaSectionName $aIniFile[$aSectionName[$i]] = $aKeyValue Next $_HINI[$hIniFile][5] = StringRegExpReplace($_HINI[$hIniFile][5], '\n\K(?is)\Q' & $sSectionName & '\E(?=\r)', StringReplace(StringReplace($aKeyValue, "\", "\\", 0, 1), "\E", "\e", 0, 1), Int($iaSectionName = 0)) Return SetError(0, @Extended, 0) Else Local $iSN = $_HINI[$hIniFile][10] If BitAND($iFlags, $INI_OVERWRITEALL_APPENDDATA) Then If BitAND($iFlags, $INI_OVERWRITEALL) Then $aIniFile[$iSN] = "" If BitAND($iFlags, $INI_STRIPLEADING) Then $aIniFile[$iSN - 1] = "" If BitAND($iFlags, $INI_STRIPTRAILING) Then $aIniFile[$iSN + 1] = "" If IsArray($aKeyValue) Then For $i = 1 To $aKeyValue[0][0] $aIniFile[$iSN] &= $aKeyValue[$i][2] & @CRLF Next Else ;; KeyName\Value\Text Data will be writte exactly as in $aKeyValue (without Edit\Formatting ect ect) $aIniFile[$iSN] &= $aKeyValue & (StringRight($aKeyValue, 1) = @LF ? "" : @CRLF) EndIf Return SetError(0, 1, 0) Else Local $asKeyValue, $iKeyValue = 0, $sKNPattern, $iOffSet = StringInStr($aIniFile[$iSN], @LF, 1) For $i = 1 To $aKeyValue[0][0] $sKNPattern = '\n[\h\f\xb\x0]*(?i)(?>\Q"' & $aKeyValue[$i][0] & '"\E|\Q' & $aKeyValue[$i][0] & '\E)[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*[^\n]*' If StringRegExp(StringLeft($aIniFile[$iSN], $iOffSet), '^(?i)[\h\f\xb\x0]*(?>\Q"' & $aKeyValue[$i][0] & '"\E|\Q' & $aKeyValue[$i][0] & '\E)[\h\f\xb\x0]*' & $scKeyName & '[\h\f\xb\x0]*[^\n]*') Then If Not BitAND($iFlags, $INI_IGNOREDUPLICATE) Then $aIniFile[$iSN] = StringRegExpReplace($aIniFile[$iSN], $sKNPattern, "") If BitAND($iFlags, $INI_DELETE) Then $aIniFile[$iSN] = StringTrimLeft($aIniFile[$iSN], $iOffSet) ElseIf Not BitAND($iFlags, $INI_NOOVERWRITE) Then $aIniFile[$iSN] = $aKeyValue[$i][2] & @CRLF & StringTrimLeft($aIniFile[$iSN], $iOffSet) EndIf ElseIf BitAND($iFlags, $INI_DELETE) Then $aIniFile[$iSN] = StringRegExpReplace($aIniFile[$iSN], $sKNPattern, "", (BitAND($iFlags, $INI_IGNOREDUPLICATE) ? 1 : 0)) Else $asKeyValue = StringRegExp($aIniFile[$iSN], $sKNPattern, 1) $iOffSet = @Extended - 1 If Not @Error Then If BitAND($iFlags, $INI_NOOVERWRITE) Then If Not BitAND($iFlags, $INI_IGNOREDUPLICATE) Then $aIniFile[$iSN] = StringLeft($aIniFile[$iSN], $iOffSet) & StringRegExpReplace(StringTrimLeft($aIniFile[$iSN], $iOffSet), $sKNPattern, "") Else $aIniFile[$iSN] = StringLeft($aIniFile[$iSN], $iOffSet + 1 - StringLen($asKeyValue[0])) & $aKeyValue[$i][2] & @CR & (BitAND($iFlags, $INI_IGNOREDUPLICATE) ? StringTrimLeft($aIniFile[$iSN], $iOffSet) : StringRegExpReplace(StringTrimLeft($aIniFile[$iSN], $iOffSet), $sKNPattern, "")) EndIf ElseIf Not BitAND($iFlags, $INI_REPLACEONLY) Then $aIniFile[$iSN] &= $aKeyValue[$i][2] & @CRLF Else $iKeyValue -= 1 EndIf EndIf $iKeyValue += 1 Next Return SetError(0, $iKeyValue, 0) EndIf EndIf EndFunc ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name...........: __IniFileWriteEx ; Description ...: Support Function for _IniFileWriteEx ; Syntax.........: __IniFileWriteEx(ByRef $hIniFile, ByRef $iFlags, ByRef $sFilePath, ByRef $iFileEncoding, ByRef $aIniFile) ; Parameters ....: See _IniFileWriteEx() ; Return values .: See _IniFileWriteEx() ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: This function is used internally by _IniFileWriteEx ; =============================================================================================================================== Func __IniFileWriteEx(ByRef $hIniFile, ByRef $iFlags, ByRef $sFilePath, ByRef $iFileEncoding, ByRef $aIniFile) Local $hFileOpen, $iSL = BitAND($iFlags, $INI_STRIPLEADING), $iST = BitAND($iFlags, $INI_STRIPTRAILING), $iReadOnly = 0 $hFileOpen = FileOpen($sFilePath, $iFileEncoding) ; Check if file opened for writing OK If $hFileOpen = -1 Then If Not BitAND($iFlags, $INI_NOWRITEREADONLY) And StringInStr(FileGetAttrib($sFilePath), "R") Then FileSetAttrib($sFilePath, "-R") $iReadOnly = 1 $hFileOpen = FileOpen($sFilePath, $iFileEncoding) If $hFileOpen = -1 Then Return SetError(10, 0, 0) Else Return SetError(10, 0, 0) EndIf EndIf FileWrite($hFileOpen, ($iSL ? "" : $aIniFile[3]) & $aIniFile[4] & ($iST ? "" : $aIniFile[5])) For $i = 6 To $aIniFile[0] Step 6 FileWrite($hFileOpen, $aIniFile[$i] & $aIniFile[$i + 1] & $aIniFile[$i + 2] & ($iSL ? "" : $aIniFile[$i + 3]) & $aIniFile[$i + 4] & ($iST ? "" : $aIniFile[$i + 5])) Next FileClose($hFileOpen) If $iReadOnly Then FileSetAttrib($sFilePath, "+R") Return 0 EndFunc ;==>__IniFileWriteEx ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name...........: __IniGetFileStringData ; Description ...: Support Function for _IniGetFileStringData ; Syntax.........: __IniGetFileStringData(ByRef $hIniFile, ByRef $iFlags, ByRef $aIniFile) ; Parameters ....: See _IniGetFileStringData() ; Return values .: See _IniGetFileStringData() ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: This function is used internally by _IniGetFileStringData ; =============================================================================================================================== Func __IniGetFileStringData(ByRef $hIniFile, ByRef $iFlags, ByRef $aIniFile) Local $sData, $iSL = BitAND($iFlags, $INI_STRIPLEADING), $iST = BitAND($iFlags, $INI_STRIPTRAILING) Local $sData = ($iSL ? "" : $aIniFile[3]) & $aIniFile[4] & ($iST ? "" : $aIniFile[5]) For $i = 6 To $aIniFile[0] Step 6 $sData &= $aIniFile[$i] & $aIniFile[$i + 1] & $aIniFile[$i + 2] & ($iSL ? "" : $aIniFile[$i + 3]) & $aIniFile[$i + 4] & ($iST ? "" : $aIniFile[$i + 5]) Next Return $sData EndFunc ;==>__IniGetFileStringData ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name...........: __IniSaveCache ; Description ...: Save in Cache last Read Section ; Syntax.........: __IniSaveCache(ByRef $hIniFile, ByRef $sSectionData, ByRef $sSectionName, ByRef $iFlags, ByRef $iSectionName, ByRef $aIniFile) ; Parameters ....: $hIniFile - Handle to the INI file to query "see _IniOpenFileEx()" ; $sSectionData - Section Strings text/data ; $sSectionName - Section Name ; $iFlags - Section Flags ; $iSectionName - Number of SectionName in INI File ; $aIniFile - Array of INI File ; Return values .: None ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: This function is Internal Only ; =============================================================================================================================== Func __IniSaveCache(ByRef $hIniFile, ByRef $sSectionData, ByRef $sSectionName, ByRef $iFlags, ByRef $iSectionName, ByRef $aIniFile) $_HINI[$hIniFile][7] = $sSectionName $_HINI[$hIniFile][8] = (BitAND($iFlags, $INI_MERGE_NOOCCURRENCE) = $INI_MERGE) ? 1 : $iSectionName $_HINI[$hIniFile][9] = $iFlags If $iSectionName > 1 And Not BitAND($iFlags, $INI_MERGE_NOOCCURRENCE) Then $aIniFile[1] = $sSectionData $_HINI[$hIniFile][10] = 1 Else $aIniFile[1] = "" $_HINI[$hIniFile][10] = $_HINI[$hIniFile][6] EndIf Return 0 EndFunc ;==>__IniSaveCache ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name...........: __GetSeparatorCharacter ; Description ...: Get Separator Character (non present character) ; Syntax.........: __GetSeparatorCharacter(ByRef $sData) ; Parameters ....: $sData - INI String\Text Data ; Return values .: None ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: For Internal Use Only ; =============================================================================================================================== Func __GetSeparatorCharacter(ByRef $sData) If Not StringInStr($sData, ChrW(8232), 1) Then Return ChrW(8232) If Not StringInStr($sData, ChrW(8233), 1) Then Return ChrW(8233) For $i = 1 To 31 If $i > 8 And $i < 14 Then ContinueLoop If Not StringInStr($sData, Chr($i), 1) Then Return Chr($i) Next $sData = StringRegExpReplace($sData, '\r\n?', @LF) Return @CR EndFunc ;==>__GetSeparatorCharacter example #include <IniEx.au3> #include <Array.au3> Local $sData = @CRLF, $aData, $iData, $iTimerDiff, $hIniFile FileDelete(@DesktopDir & "\Test.ini") For $i = 1 To 10 $sData &= "[SectionName_" & $i & "]" & @CRLF For $y = 1 to 100000 $sData &= "KeyName" & $y & " = Value" & $y & @CRLF Next Next FileWrite(@DesktopDir & "\Test.ini", $sData) ;25 MB - 1.000.000 Line, Key-Value $sData = "" $iTimerDiff = TimerInit() ;;_IniOpenFileEx() $hIniFile = _IniOpenFileEx(@DesktopDir & "\Test.ini") If @Error Then ConsoleWrite("Error - " & @Error & @LF) Exit EndIf $iTimerDiff = TimerDiff($iTimerDiff) ConsoleWrite("_IniOpenFileEx TimerDiff - " & $iTimerDiff & @LF) $iTimerDiff = TimerInit() ;;_IniGetSectionNumberEx() $iData = _IniGetSectionNumberEx($hIniFile) If @Error Then ConsoleWrite("Error - " & @Error & @LF) Exit EndIf $iTimerDiff = TimerDiff($iTimerDiff) ConsoleWrite("IniGetSectionNumberEx TimerDiff - " & $iTimerDiff & @LF) ConsoleWrite("SectionNumber - " & $iData & @LF & @LF) $iTimerDiff = TimerInit() ;;_IniRenameSectionEx() _IniRenameSectionEx($hIniFile, "SectionName_10", "SectionName_111") If @Error Then ConsoleWrite("Error - " & @Error & @LF) Exit EndIf $iTimerDiff = TimerDiff($iTimerDiff) ConsoleWrite("IniRenameSectionEx TimerDiff - " & $iTimerDiff & @LF & @LF) $iTimerDiff = TimerInit() ;;_IniReadSectionNamesEx() $aData = _IniReadSectionNamesEx($hIniFile) If @Error Then ConsoleWrite("Error - " & @Error & @LF) Exit EndIf $iTimerDiff = TimerDiff($iTimerDiff) ConsoleWrite("IniReadSectionNamesEx TimerDiff - " & $iTimerDiff & @LF & @LF) _ArrayDisplay($aData) $iTimerDiff = TimerInit() ;;_IniReadSectionEx() $sData = _IniReadSectionEx($hIniFile, "SectionName_8") $iTimerDiff = TimerDiff($iTimerDiff) ConsoleWrite("IniReadSectionEx TimerDiff - " & $iTimerDiff & @LF & @LF) ;;ConsoleWrite($sData & @LF & @LF) ;;MsgBox(0, "SectionName_8", $sData) $iTimerDiff = TimerInit() ;;_IniReadSectionEx() $aData = _IniReadSectionEx($hIniFile, "SectionName_8", $INI_2DARRAYFIELD) ;$INI_NOOCCURRENCE + $INI_MERGE + $INI_2DARRAYFIELD $iTimerDiff = TimerDiff($iTimerDiff) ConsoleWrite("IniReadSectionEx TimerDiff - " & $iTimerDiff & @LF & @LF) _ArrayDisplay($aData, "IniReadSectionEx") $iTimerDiff = TimerInit() ;;_IniReadEx() $sData = _IniReadEx($hIniFile, "SectionName_8", "KeyName99980") $iTimerDiff = TimerDiff($iTimerDiff) ConsoleWrite("IniReadEx TimerDiff - " & $iTimerDiff& @LF) ConsoleWrite($sData & @LF & @LF) $iTimerDiff = TimerInit() ;;_IniReadEx() $aData = _IniReadEx($hIniFile, "SectionName_8", "KeyName99988", "Default Return", $INI_ARRAYDATA) ;$INI_NOOCCURRENCE + $INI_MERGE + $INI_ARRAYDATA $iTimerDiff = TimerDiff($iTimerDiff) ConsoleWrite("IniReadEx TimerDiff - " & $iTimerDiff & @LF) ConsoleWrite($aData[1] & @LF & @LF) _ArrayDisplay($aData, "IniReadEx") $iTimerDiff = TimerInit() ;;_IniDeleteEx() _IniDeleteEx($hIniFile, "SectionName_8", "KeyName99988") ;$INI_IGNOREDUPLICATE + $INI_NOOCCURRENCE + $INI_REMOVE $iTimerDiff = TimerDiff($iTimerDiff) ConsoleWrite("IniDeleteEx TimerDiff - " & $iTimerDiff & @LF & @LF) $iTimerDiff = TimerInit() ;;_IniWriteSectionEx() _IniWriteSectionEx($hIniFile, "SectionName_8", "KeyNameX = ValueX") ; $INI_NOOCCURRENCE + $INI_IGNOREDUPLICATE + $INI_MERGE + $INI_REMOVE + $INI_OVERWRITEALL + $INI_APPENDDATA $iTimerDiff = TimerDiff($iTimerDiff) ConsoleWrite("IniWriteSectionEx TimerDiff - " & $iTimerDiff & @LF & @LF) ConsoleWrite(_IniReadEx($hIniFile, "SectionName_8", "KeyNameX") & @LF) $iTimerDiff = TimerInit() For $i = 1 To 5 _IniWriteSectionEx($hIniFile, "SectionName_8", "KeyNameX" & $i & " = ValueX" & $i) Next For $i = 6 To 10 _IniWriteEx($hIniFile, "SectionName_8", "KeyNameX" & $i, "ValueX" & $i) Next $iTimerDiff = TimerDiff($iTimerDiff) ConsoleWrite("IniWrite*Ex TimerDiff - " & $iTimerDiff & @LF) $iTimerDiff = TimerInit() ;;_IniReadEx() For $i = 1 To 10 ConsoleWrite(_IniReadEx($hIniFile, "SectionName_8", "KeyNameX" & $i) & @LF) Next $iTimerDiff = TimerDiff($iTimerDiff) ConsoleWrite("IniReadEx TimerDiff - " & $iTimerDiff & @LF) _IniCloseFileEx($hIniFile) Exit ;~ >Running:(3.3.11.3):C:\Program Files (x86)\AutoIt3\Beta\autoit3.exe "C:\Users\DXRW4E\Desktop\New AutoIt v3 Script.au3" ;~ --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop ;~ _IniOpenFileEx TimerDiff - 2656.48548057389 ;~ IniGetSectionNumberEx TimerDiff - 0.0343594296492653 ;~ SectionNumber - 10 ;~ ;~ IniRenameSectionEx TimerDiff - 0.204971769976651 ;~ ;~ IniReadSectionNamesEx TimerDiff - 0.0584505240010489 ;~ ;~ IniReadSectionEx TimerDiff - 6.80316707055452 ;~ ;~ IniReadSectionEx TimerDiff - 1831.04639075913 ;~ ;~ IniReadEx TimerDiff - 24.1380917325683 ;~ Value99980 ;~ ;~ IniReadEx TimerDiff - 111.67841469541 ;~ Value99988 ;~ ;~ IniDeleteEx TimerDiff - 43.9488700091941 ;~ ;~ IniWriteSectionEx TimerDiff - 28.2560891228314 ;~ ;~ ValueX ;~ IniWrite*Ex TimerDiff - 261.353224415258 ;~ ValueX1 ;~ ValueX2 ;~ ValueX3 ;~ ValueX4 ;~ ValueX5 ;~ ValueX6 ;~ ValueX7 ;~ ValueX8 ;~ ValueX9 ;~ ValueX10 ;~ IniReadEx TimerDiff - 261.622965684803 ;~ +>00:07:21 AutoIt3.exe ended.rc:0 ;~ >Exit code: 0 Time: 5.914 ; $INI_OPEN_FILEQUEUE (268435456) - Open INI file from Memory\Variable, $sFilePath must contain String Text Data of INI file $hIniFile = _IniOpenFileEx(@DesktopDir & "\Test.ini") ;ect ect ect ;or $hIniFile = _IniOpenFileEx($sData, $INI_OPEN_FILEQUEUE) ;ect ect ect ;Or direct mode, without load ini or using handles ; $sSectionName - The name of the section containing the Key\Value, This parameter can be NULL (use the $NULL_REF to set NULL this parameter) ; If $sSectionName is NULL, $hIniFile must be contain Section String\Key\Value\Data ;; _IniDeleteEx($hIniFile, $sSectionName, $sKeyName) _IniDeleteEx($sData, $NULL_REF, $sKeyName) ;$NULL_REF = NULL ;; _IniReadEx($hIniFile, $sSectionName, $sKeyName) _IniDeleteEx($sData, $NULL_REF, $sKeyName) ;$NULL_REF = NULL ;; _IniReadSectionEx($hIniFile, $sSectionName, $sKeyName) _IniReadSectionEx($sData, $NULL_REF, $sKeyName) ;$NULL_REF = NULL ;; _IniWriteEx($hIniFile, $sSectionName, $sKeyName, $sValue) _IniWriteEx($sData, $NULL_REF, $sKeyName, $sValue) ;$NULL_REF = NULL ;;ect ect ect So for all other functions IniEx.au3
  9. How to get the thrid number of a file version. Example: Let's say I have a file with below properties. I want only the third number like here it is 1941 as highlighted. Is there any built in function to get it??
  10. Generally we will use tools like Winmerge or Beyond Compare for this purpose. Are there any UDF or libraries available in AutoIT to compare any two files or folder contents.
  11. I've run into the problem where multiple script processes writing to a log file at the same time can interfere with one another. That is, file writes using FileWriteLine are not atomic, so a line of text from one process can have fragments of text from other processes mixed in with it. Exclusive file-locking should take care of the problem. Looking through the standard UDFs, I see that _WinAPI_LockFile is available, but according to the MSDN documentation it doesn't block - it returns immediately if the lock can't be obtained - and there doesn't seem to be a UDF for the LockFileEx function. I considered writing my own UDF for LockFileEx, but some aspects (e.g., creating the OVERLAPPED structure and its members) look too complex for the amount of time I have available. I think approximating LockFileEx using LockFile could solve my problem, but I'd like to keep it simple while still working reliably. I'm not confident that (e.g.) a simple retry loop to simulate blocking will be adequate. Any suggestions for a simple way to achieve exclusive file-locking with blocking?
  12. Hi! I want to send by mail some files with a certain extension (.xml in my case). These files are located in the script folder. First, I thought to use _FileListToArrayRec function to have a list of these files. But than I don't know how to send them all at once. I know that I can attach multiple files in this way: path1;path2;path3; etc. and so I have tried to make a string of this type with the path of the files (with a for loop) but It doesn't attach any file (only instructions.txt). How could I do? ( what I did is just an idea, if there's something better that would be great) Thanks! $aArrayXml = _FileListToArrayRec(@ScriptDir, "*.xml", $FLTAR_FILES) _ArrayDisplay($aArrayXml, "LIST XML") $LenghtArrayXml = UBound($aArrayXml) If ($LenghtArrayXml > 2) Then For $i = 2 To $LenghtArrayXml - 1 $temp = "&@ScriptDir&""\"&$aArrayXml[$i]&";"&"""" $XmlListFile = $XmlListFile & $temp Next EndIf $XmlListFile = StringTrimLeft($XmlListFile, 1) if($LenghtArrayXml = 2)Then $rc =_INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, @ScriptDir&"\"&$aArrayXml[1]&";"&@ScriptDir&"\instructions.txt", $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl) Else $rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, @ScriptDir&"\"&$aArrayXml[1]&$XmlListFile&@ScriptDir&"\instructions.txt", $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl) EndIf
  13. I'm trying to check for the existance of a file, on logon the file is there, then gets deleted and after a while recreated. I'm using this code: Sleep(100) If not FileExists($sFile) Then Sleep(150) If FileExists($sFile) Then GUICtrlSendToDummy($iDummy) What happens is this: User logs on, the file is present, or at least it usually is After about 10 seconds the file gets deleted Then after about 50 seconds the file gets created again, this is when I need the check, because now the process is finished. The above code is part of a pretty long do....until false loop running an animation. The problem is that sometimes this code fails. Without the sleep statements it didn't work at all so I think this is a timing issue. Pretty primitive code I admit, there must be a better way...
  14. hi I'm trying to execute files I want it to run in order. for instance, if there's folder like below, I want to run 1.exe > 2.exe > 3.exe root folder |___folder 1 > 1.exe |___folder2 > 2.exe |___folder3 > 3.exe What I did to do the above, was to make a text file that contains the path to each of those files and put those in array form. but copying and pasting every path of those files into a text file is very exhausting thing to do when there's like hundreds of files to execute. So I was wondering if there is a simple way to run those files. I'd be thankful if anybody answers it.
  15. Hello, I am trying to updated a autoit app that moves files from one location to another. What Ia m trying to do is exclude specified sub directories from being moved/copied or files within the sub-folders As of now the code doesn't want to execute the nested for loop Global $szDrive, $szDir, $szFName, $szExt Global $File = "*" func File_mover($Src,$File,$Dst) ; GET DIRECTORY EXCLUDES ; ###################### ; Create blank 2 dem array Local $ExArray[0][1] ; load ini file Local Const $sFilePath = "exclude.ini" ; Check to see if ini exists Local $iFileExists = FileExists($sFilePath) ; If the INI file is not found, output error message If not $iFileExists Then msgbox(0,"Oh NO!", $sFilePath & " not found!") endif ; Read ini file Local $aArray = IniReadSection($sFilePath, "test") ; Start the array loop If Not @error Then for $i = 1 to $aArray[0][0] ; Add Ini values into array _ArrayAdd($ExArray, $aArray[$i][1]) next endif ; Display array ;_ArrayDisplay($ExArray, "test Label") ProgressOn("Moving Scanned File(s)", "Moving scans into citrix...", "0%") $aFiles = _FileListToArray3($Src, $File, 1, 1, 0, 0) For $i = 1 To $aFiles[0] call("_PathSplit",$aFiles[$i], $szDrive, $szDir, $szFName, $szExt) $SrcFile = $Src & "\" & $szDrive & $szDir & $szFName & $szExt $DstFile = $Dst & "\" & $szDir & $szFName & $szExt $NumFiles = DirGetSize($Src,1) ; If File Exsists copy and rename file If FileExists($DstFile) Then $DstFile = call("_IfIdenticalIncrement", $SrcFile, $DstFile) If $DstFile <> "" Then For $ii = $NumFiles[1] To 100 Step 10 ProgressSet($ii, $ii & "%","Moving Files...") ; Move Scans ; List Dir in srouce dir $dirEx = _FileListToArray($Src,"*",2) If UBound($dirEx) > 1 Then ; Look in the dir list array For $dir In $dirEx ; Find and compaire dir in exclude array For $exclude In $ExArray If ($dir = $exclude) Then ; if exclude dir found go to top loop and skip ContinueLoop 2 EndIf Next FileMove($SrcFile, $DstFile, 8) Next endif Sleep(100) Next EndIf ; File doesnt exists so copy the file over Else For $ii = $NumFiles[1] To 100 Step 10 ProgressSet($ii, $ii & "%","Moving Files...") ; Move Scans ; List Dir in srouce dir $dirEx = _FileListToArray($Src,"*",2) If UBound($dirEx) > 1 Then ; Look in the dir list array For $dir In $dirEx ; Find and compaire dir in exclude array For $exclude In $ExArray If ($dir = $exclude) Then ; if exclude dir found go to top loop and skip ContinueLoop 2 EndIf Next FileMove($SrcFile, $DstFile, 8) Next endif Sleep(100) next EndIf ProgressSet(100, "Scans Moved...Successfully!", "Done!") sleep(2000) ProgressOff() Next endfunc Func _IfIdenticalIncrement($vSrcFile, $vDstFile) Local $Count = 0 ; Get the modified date of the source file. $ScrVer = FileGetTime($vSrcFile, 0, 1) ; To get all elemnt of the distination file (in plan to add incremental number). call("_PathSplit",$vDstFile, $szDrive, $szDir, $szFName, $szExt) ; Loop to increment the name of the file. While FileExists($vDstFile) $Count += 1 $vDstFile = $szDrive & $szDir & $szFName & "(" & $Count & ")" & $szExt WEnd ; If file(1), it assume that is the first copy. If $Count = 1 Then Return $vDstFile ; If file(x-1) is identical then assume the file is already duplicated. ElseIf $ScrVer = FileGetTime($szDrive & $szDir & $szFName & "(" & $Count - 1 & ")" & $szExt, 0, 1) Then Return "" ; Else assume it is a new version. Else Return $vDstFile EndIf EndFunc ;==>_IfIdenticalIncrement This part is skipped and not sure why For $exclude In $ExArray If ($dir = $exclude) Then ; if exclude dir found go to top loop and skip ContinueLoop 2 EndIf Next INI file is this [test] EXCLUDE1=test1 EXCLUDE2=test2 EXCLUDE3=test3
  16. Hey there folks! Task: I have an array of DllStructs, created with the function DllStructCreate. Let's call the array $structs. This $structs contains important information for the program. I want to save my $structs variable for future use in a file (i.e.: the user closes the program, opens it again and has the option to load a file). I want to load files which contain a $structs variable, and let the program work with this "loaded" variable. Questions: Since I have never done such a thing (saving/loading a file, possibly in a different format from txt or ini), I'd like to know: Is this possible? Is my only option to save my $structs in text format? That would require a function which receives a file and interprets the text it has, creating a new $structs with the info it's getting from the file. (I think this could lead to trouble) I'm worried about security. Since the program will be loading files, I don't want it to crash because the user decided to give it modified files. Is it possible to create a file that's readonly for the user? That would prevent some tampering with the file. From what I've been reading, I have several functions available for File management, namely FileOpen, FileRead and FileWrite. In a first glance, these appear to be the only functions I need. Do I need more? Thank you for your time! Cheers!
  17. i used this code to take names for a text file called data and put the info of the image and it location from the data file into the gui interface but it only detect the lines with the info and it do not show the images . here is the code #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <AVIConstants.au3> #include <TreeViewConstants.au3> #include <GuiComboBox.au3> #include <GuiTab.au3> #include <file.au3> #include <array.au3> _Main() Func _Main() Local $idTab1 $Form1 = GUICreate("Form1", 500, 334, 240, 182) $Group1 = GUICtrlCreateGroup("Group1", 20, 12, 249, 314) $idButton6 = GUICtrlCreateButton("Info", 50, 270, 185, 49) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) Global $fileMPA = "C:\T-in\MPA\data.txt" FileOpen($fileMPA, 0)    Global $line1 = FileReadLine($fileMPA , 1) $imp = 0 $idTab1 = GUICtrlCreateTab(300, -3, 180, 330) GUICtrlCreateTabItem("imglist1") GUICtrlSetTip(-1, '#Region TAB1') GUICtrlSetTip(-1, '#Region LIST') Local $imglist1 = GUICtrlCreateList("", 307, 26, 164, 304) $cline =_FileCountLines($fileMPA)  While  $imp < $cline $line2 = FileReadLine($fileMPA , $imp + 2)  $imp = $imp + 7 if $line2 = ""  then     ExitLoop    else  GUICtrlSetData(-1, ""& $line2 &"", "")  endif WEnd GUICtrlCreateTabItem("imagelist2") GUICtrlSetTip(-1, '#Region TAB2') GUICtrlCreateTabItem("imagelist3") GUICtrlSetTip(-1, '#Region TAB3') While 1     $Msg = GUIGetMsg()     Select         Case $Msg = $GUI_EVENT_CLOSE             Exit             Global $whatnow = GUICtrlRead($imglist1) Case $Msg = $idButton6             $imp2 = 0              While  $imp2 < 30 $line2 = FileReadLine($fileMPA ,$imp2 + 2) $line3 = FileReadLine($fileMPA , $imp2 + 3) $line7 = FileReadLine($fileMPA , 7)  $imp2 = $imp2 + 7 if $line2 = ""  then  ExitLoop             If GUICtrlRead($imglist1) = ""& $line2 &""  Then MsgBox($MB_SYSTEMMODAL, "img info" , $line3)                WEnd             EndSelect $imp2 = 0              While  $imp2 < 30 $line2 = FileReadLine($fileMPA ,$imp2 + 2) $line3 = FileReadLine($fileMPA , $imp2 + 3) $line7 = FileReadLine($fileMPA , 7)  $imp2 = $imp2 + 7     Select Case GUICtrlRead($imglist1) = ""& $line2 &"" if $line2 = "" then ExitLoop     $Pic1 = GUICtrlCreatePic(""& $line7 &"", 185, 28, 233, 230) If GUICtrlRead($imglist1) then  ExitLoop EndSelect WEnd     WEnd  EndFunc   ;==>_Main the data.txt file content is Hibiscus Hibiscus is a hardy perennial which grows in variety of colors, sizes and fragrances. Actually they are tropical flowers which require ample sunlight and moisture to grow well. These flowers start blooming in late spring and continuously bloom through July and August. C:\T-in\IMG\2.jpg Lilies There are different types of lily flowers which bloom in August including water lilies, tiger lilies and gold band lilies. Tiger lilies generate orange flowers having black spots. This lily blooms in delayed July and beginning of August. Gold band lily produce exotic white blooms. All varieties of lilies need enough space to grow and protection from summer sun. C:\T-in\IMG\1.jpg Turtlehead Growing in humid areas, turtleheads are small flowers which bloom from July to September. They mostly produce flowers of white and pink color. C:\T-in\IMG\3.jpg Hydrangea These are ever green bushes which produce flowers in different colors including white, purple, blue and pink. They are easy to grow bushes and can grow 3 to 10 feet tall. They require morning sun to grow but they should be protected from noon and afternoon sun. C:\T-in\IMG\4.jpg Dahlias August proves to be the peak blooming season for dahlias. Dahlias come in colors like white, orange, yellow, red and purple. They can tolerate all types of soil and require full sun to grow.
  18. #include <ColorConstants.au3>; Including required files #include <GUIConstantsEx.au3> #include <file.au3> #include <Array.au3> #include <string.au3> Example() Func Example() Local $hash Local $hashes = "hash.txt" _FileReadToArray($hashes, $hash) For $i = 1 To UBound($hash) - 500 $hashcheck = $hash[$i] $PDenc = "hash=" & $hashcheck & "&decrypt=Decrypt" $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", "http://myurl/", False) ; Post url $oHTTP.SetRequestHeader("Host", "myurl") $oHTTP.SetRequestHeader("Connection", "keep-aliveContent-Length: 29") $oHTTP.SetRequestHeader("Cache-Control", "max-age=0") $oHTTP.SetRequestHeader("Origin", "http://myurl") $oHTTP.SetRequestHeader("Upgrade-Insecure-Requests", "1") $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36") $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") $oHTTP.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8") $oHTTP.SetRequestHeader("Referer", "http://myurl") $oHTTP.SetRequestHeader("Accept-Language", "en-US,en;q=0.8") $oHTTP.Send($PDenc) $oReceived = $oHTTP.ResponseText $oStatusCode = $oHTTP.Status sleep(2000) If $oStatusCode = 503 then MsgBox(4096, "Response code", $oStatusCode) ExitLoop EndIf ; Saves the body response regardless of the Response code $file = FileOpen("Received.html", 2) ; The value of 2 overwrites the file if it already exists FileWrite($file, $oReceived) $read = FileRead("Received.html") ;read file if StringInStr($read, "not found") Then ContinueLoop Else ContinueLoop $Datastring = ('</script></div><br/>') $newreadamount = _StringBetween($read, $Datastring, "</b><br/><br/>") ;read title from file $newreadamount[0] = StringReplace($newreadamount[0], '<b>', "") ; taking out the X makes it easier to compare value If @error Then ContinueLoop EndIf $file = FileOpen("decrypted.txt", 1) FileWrite($file, $newreadamount[0] & @CRLF) EndIf Next sleep(2000) EndFunc ;==>Example As you can read my script loads 500 lines of text, lets say I have a list with 10.000 lines Is there a way to show a progressbar GUI to show how long in a text file I am? I may not know how long a particular .txt file is always so I am thinking I need some sort of algorythm? Thanks in advance. ( I just got unclear if I actually read 500 lines each attempt or if I start with 500 and add 1 to it each time? ) For $i = 1 To UBound($hash) - 500 ; LIke that ^ For $i = 500 To UBound($hash) - 500 ; or like this^ Thanks a lot.
  19. I have a string looking like this: Outsider:myemail@myemail.com:26e0112200304f6d7598f6bd90a8478d:_KPQX)B7C0IX~!QgqG*V*){X<71O{{ This is how my database looks, I would like to split my file in to User Email Hash:Salt The reason why I wish to do this is to have an easier view of my users, I may also want to encrypt passwords even further and I cannot do this with a string looking like that! Thanks in advance.
  20. Hi Let's say I get a path called "E:\pics\". It has pictures inside which are numbered starting at 0. Then we get something like "E:\pics\0" or "E:\pics\1" or "E:\pics\2"... The amount of numbers, thus the path of the last picture, are known to me already. For example, there are 100 pictures, which means that the files start at 0 and end at 99 However, for some things that isn't enough, because they need the file extension. They can be pretty "random", though. Sometimes it's a JPG, sometimes it's a PNG, sometimes it's a GIF. So, I know need some kind of function that gets me the file extension, or the complete path, from an incomplete path. The input would be "E:\pics\1" and I expect and output of "E:\pics\1.jpg" for example. Also, there is just one file extension per number. For example, it there is "E:\pics\1.jpg", there won't be a "E:\pics\1.png" anymore. And this will be looped as well. First I get number 0, then number 1, then number 2, and so on. So I need something that is able to be repeated in a for-loop without causing problems with the parameters. Thanks a lot!
  21. I'm writing a small program for creating a backup. I want to do that by using FileCopy. Everything from drive C should be copied to drive D. FileCopy("C:", "D:", $FC_OVERWRITE + $FC_CREATEPATH) That doesn't do anything, though. I played a bit with the paths, but nothing does what I want. Sometimes only the folder of the program itself is copied, sometimes nothing is copied. What am I doing wrong? What do I have to do that everything from C goes to D? Thanks! Backup.au3 Edit: DirCopy does pretty much the same
  22. I need to find a way to cick a file Browse button on a website and then upload an image that was previously selected by the user via an Autoit gui... (as you will see I am assigning $imUpload the file path via guictrlread for each of the selected Images.... It will do just fine going though the submission process until it gets to this image upload page. When it gets to this page it will open the file upload box (here is a pic of it being opened by the autoit script: http://snag.gy/171RS.jpg As you can clearly see it opens the image upload box just fine however it does not send the file path via Send($imUp1) "here is a pic of the msgbox that is showing me it did grab the right file path for the image: However that msgbox doesn't show up unless I close the file upload box... so that is where the code freezup has been narrowed down to... I have tried to be as specific as possible if there is anymore info I can provide that would be usefull please let me know Here is what I have so far code wise... (i know its hack/slash im new to guis and autoit coding sorry for the eyehurt) *any commented lines of code I have tried but couldn't get them to work... the uncommented lines get the farthest out of them all* Do $imUpload = $imUploadCount + 1 If $ImageCount >= 6 Then $ImageCount = 6 EndIf $oForm = _IEFormGetObjByName($ksl, "f-142") $oInputFile = _IEFormElementGetObjByName($oForm, "142") ;Assign input focus To the field And Then send the text string ;_IEAction($oInputFile, "focus") ;$iBrowserX = _IEPropertyGet($oInputFile, "browserx") ;$iBrowserY = _IEPropertyGet($oInputFile, "browsery") ;$iWidth = _IEPropertyGet($oInputFile, "width") ;$iHeight = _IEPropertyGet($oInputFile, "height") ;ControlClick(_IEPropertyGet($ksl, "hwnd"), "", "", "left", 1, $iBrowserX + $iWidth / 2, $iBrowserY + $iHeight / 2) _IEAction($oInputFile, "click") ;$oInputFile = _IELinkGetCollection($ksl, 142) ;$oInputFile.fireEvent("onmouseup") ;$oInputFile.click If $imUpload = 1 Then $imUp1 = GUICtrlRead($Image1) Sleep(1500) ElseIf $imUpload = 2 Then $imUp1 = GUICtrlRead($Image2) Sleep(1500) ElseIf $imUpload = 3 Then $imUp1 = GUICtrlRead($Image3) Sleep(1500) ElseIf $imUpload = 4 Then $imUp1 = GUICtrlRead($Image4) Sleep(1500) ElseIf $imUpload = 5 Then $imUp1 = GUICtrlRead($Image5) Sleep(1500) ElseIf $imUpload = 6 Then $imUp1 = GUICtrlRead($Image6) Sleep(1500) EndIf MsgBox("MSG", "$imUp1", $imUp1) Send($imUp1) Sleep(1500) Send("{ENTER}") ;Find Image Description field! $descriptionimfield = _IEGetObjById($ksl, "d-142") If Not @error Then ; MsgBox("Success", "Email Input Found", "Next Step!") Else ;MsgBox("Failed", "Email Input Not Found", "Try Again!") Exit EndIf ;Fill Image Description(s) field! If $imUpload = 1 Then _IEFormElementSetValue($descriptionimfield, $Image1_Description) If Not @error Then ; MsgBox("Success", "Email Input Filled", "Next Step!") Else ;MsgBox("Failed", "Email Input Not Filled", "Try Again!") Exit EndIf ElseIf $imUpload = 2 Then _IEFormElementSetValue($descriptionimfield, $Image2_Description) If Not @error Then ; MsgBox("Success", "Email Input Filled", "Next Step!") Else ;MsgBox("Failed", "Email Input Not Filled", "Try Again!") Exit EndIf ElseIf $imUpload = 3 Then _IEFormElementSetValue($descriptionimfield, $Image3_Description) If Not @error Then ; MsgBox("Success", "Email Input Filled", "Next Step!") Else ;MsgBox("Failed", "Email Input Not Filled", "Try Again!") Exit EndIf ElseIf $imUpload = 4 Then _IEFormElementSetValue($descriptionimfield, $Image4_Description) If Not @error Then ; MsgBox("Success", "Email Input Filled", "Next Step!") Else ;MsgBox("Failed", "Email Input Not Filled", "Try Again!") Exit EndIf ElseIf $imUpload = 5 Then _IEFormElementSetValue($descriptionimfield, $Image5_Description) If Not @error Then ; MsgBox("Success", "Email Input Filled", "Next Step!") Else ;MsgBox("Failed", "Email Input Not Filled", "Try Again!") Exit EndIf ElseIf $imUpload = 6 Then _IEFormElementSetValue($descriptionimfield, $Image6_Description) If Not @error Then ; MsgBox("Success", "Email Input Filled", "Next Step!") Else ;MsgBox("Failed", "Email Input Not Filled", "Try Again!") Exit EndIf EndIf ;Go to Next page! $oButtons = _IETagNameGetCollection($ksl, "input") For $oButton In $oButtons If String($oButton.value) = "Upload File" Then _IEAction($oButton, "click") ;MsgBox("Success", "Login Successful!", "Login Credentials Verified!") ExitLoop Else EndIf Next Sleep(2000) Until $imUpload >= $ImageCount Here is a picture of the webpage that I am interacting with in IE: http://snag.gy/7hQ4y.jpg Here is the webpage code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <meta http-equiv="X-UA-Compatible" content="IE=8" /> <!-- template-beta --> <script type="text/javascript"> var xdbt_start = (new Date()).getTime(); </script> <!-- <script src="/scripts/search.js" language="javascript" type="text/javascript"></script> --> <title>Place a FREE Classified Ad | ksl.com</title> <meta property="og:title" content="Place a FREE Classified Ad | ksl.com" /> <meta name="keywords" content="news, traffic, weather, sports, classifieds, cars, jobs, homes, television, radio, salt lake, utah, local" /> <meta name="description" content="The KSL.COM Website" /> <meta name="publication_date" content="2005-07-31" /> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Language" content="en-us" /> <meta http-equiv="imagetoolbar" content="no" /> <meta name="verify-v1" content="Hfa7cDQ0+6irKfA233lorv0N2hQ99FyQwAkFAkWMk+U=" /> <meta property="og:image" content="" /> <meta property="og:type" content="article" /> <meta name="author" content="" /> <meta property="og:article:author" content="" /> <meta name="Copyright" content="Copyright (c) KSL.COM" /> <meta name="robots" content="all" /> <meta name="MSSmartTagsPreventParsing" content="true" /> <meta name="Rating" content="General" /> <meta name="revisit-after" content="1 Day" /> <meta name="doc-class" content="Living Document" /> <style type="text/css" media="screen">@import "/templates/template-v3.css";</style> <style type="text/css" media="screen">@import "/templates/navPopOver.css";</style> <script type="text/javascript" src="/packages/jquery/jquery-1.7.min.js"></script> <script type="text/javascript" src="/packages/jquery/bgiframe-2.1.1.js"></script> <script type="text/javascript" src="/packages/jquery/dimensions-1.2.0.js"></script> <script type="text/javascript" src="/packages/jquery-ui/jquery-ui-1.8.16.custom.min.js"></script> <!-- <script type="text/javascript" src="/javascript/popOverMenu.js"></script> --> <!-- <script type="text/javascript" src="/javascript/tvRadioPopOver.js"></script> --> <style type="text/css" media="projection">@import "/templates/template-v3.css";</style> <link rel="canonical" href="http://www.ksl.com/?nid=640&sid=4516794" /> <meta property="og:url" content="http://www.ksl.com/?nid=640&sid=4516794" /> <link rel="apple-touch-icon" href="apple-touch-icon.png" /> <link rel="stylesheet" media="only screen and (max-device-width:480px)" href="/templates/navPopOver.css" type="text/css" /> <link rel="stylesheet" media="screen and (min-device-width:481 px)" href="/templates/navPopOver.css" /> <link type="text/css" rel="stylesheet" media="print" href="/templates/navPopOver.css" /> <link type="text/css" rel="stylesheet" media="handheld" href="/templates/navPopOver.css" /> <link type="text/css" rel="alternate stylesheet" href="/templates/navPopOver.css" title = "mobile"/> <link rel="stylesheet" media="only screen and (max-device-width:480px)" href="/templates/template-v3.css" type="text/css" /> <link rel="stylesheet" media="screen and (min-device-width:481 px)" href="/templates/template-v3.css" /> <link type="text/css" rel="stylesheet" media="print" href="/templates/template-v3.css" /> <link type="text/css" rel="stylesheet" media="handheld" href="/templates/template-v3.css" /> <link type="text/css" rel="alternate stylesheet" href="/templates/template-v3.css" title = "mobile"/> <link type="image/x-icon" rel="Shortcut Icon" href="/favicon.ico" /> <link rel="help" href="/about.php" title="Site info" /> <script type="text/javascript"> function openMenu(mid) { document.getElementById(mid).style.display = 'block'; } function openScript(url, width, height) { var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,menubar=no,status=yes' ); } function logondemand(action) { document.getElementById('onDemandback').src = "http://tools.bonnint.net/ondemandlogger.php?action=" + action; } var init_object = new Object; $(document).ready( function() { for (var i_func in init_object) { init_object[i_func](); } }); </script> <!-- Make Dropdowns work on iPad --> <!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { if(navigator.platform == "iPad") { $("a").each(function() { // have to use an `each` here - either a jQuery `each` or a `for(...)` loop var onClick; // this will be a function var firstClick = function() { onClick = secondClick; return false; }; var secondClick = function() { onClick = firstClick; return true; }; onClick = firstClick; $(this).click(function() { return onClick(); }); }); } }); </script> --> <!-- End Make Dropdowns work on iPad --> <script type="text/javascript"> var _user_id = 2566029; // IMPORTANT! Set to the user's ID, username, or email address, or '' if not yet known. var _session_id = '0e98c75518605de0b498139d5d5f1c1e'; // Set to a unique session ID for the visitor's current browsing session. var _sift = _sift || []; _sift.push(['_setAccount', "46e0e4c3e4"]); _sift.push(['_setUserId', _user_id]); _sift.push(['_setSessionId', _session_id]); _sift.push(['_trackPageview']); (function() { function ls() { var e = document.createElement('script'); e.type = 'text/javascript'; e.async = true; e.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.siftscience.com/s.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s); } if (window.attachEvent) { window.attachEvent('onload', ls); } else { window.addEventListener('load', ls, false); } })(); </script> </head> <body > <script type="text/javascript"> $(document).ready(function(){ $('#adTakeOverLeft, #adTakeOverRight').each(function(){ var elem = $(this); var top = elem.offset().top; if ($(window).scrollTop() > top) { elem.animate({ top: $(window).scrollTop() }, 500); } $(window).scroll(function(){ var offset = top - $(window).scrollTop(); offset = (offset > 0) ? offset : 0; elem.stop(true).css({ top: offset, position: 'fixed' }); }); }); }); </script> <style> #adTakeOverLeft, #adTakeOverRight { position: absolute; /* set to fixed in js */ top: 143px; margin:0; width:200px; overflow:visible; } #adTakeOverLeft { left: 50%; margin:0 0 0 -712px; *margin:0 0 0 -1024px; text-align:right; } #adTakeOverRight { right: 50%; margin: 0 -712px 0 0; text-align:left; } .adTakeOverInner img { border:0; } .adTakeOverInner a:link, .adTakeOverInner a:visited, .adTakeOverInner a:hover { text-decoration: none; } #adTakeOverLeft .adTakeOverInner { float:right; } #adTakeOverRight .adTakeOverInner { float:left; } /* @todo: delete this #mainoutsideBlock { background:gray; } #mainBlock { background:silver; } #bodyBlock { background:tan; } */ </style> <div id="adTakeOverLeft"> <div class="adTakeOverInner"> <!-- <img src="http://s0.2mdn.net/viewad/3065301/AFCU_Auto_300x600_2_13_12.jpg" /> --> <!-- <img src="/graphics/takeover_left.jpg" /> --> </div> </div> <div id="adTakeOverRight"> <div class="adTakeOverInner"> <!-- <img src="http://s0.2mdn.net/viewad/3065301/AFCU_Auto_300x600_2_13_12.jpg" /> --> <!-- <img src="/graphics/takeover_right.jpg" /> --> </div> </div> <style> #navMenu a.active { text-decoration: underline; } #headMenu a:hover { background: #b1cdff !important; border-radius: 2px 2px 0px 0px !important; /* top left, top right, bottom right, bottom left */ -webkit-border-radius: 2px 2px 0px 0px !important; -moz-border-radius: 2px 2px 0px 0px !important; } #headMenu a:hover img { background-color: #b1cdff !important; border-radius: 2px 2px 0px 0px !important; /* top left, top right, bottom right, bottom left */ -webkit-border-radius: 2px 2px 0px 0px !important; -moz-border-radius: 2px 2px 0px 0px !important; } #navBlock { background: rgb(177, 205, 255) !important; /* Old browsers */ background: -moz-linear-gradient(top, rgba(177, 205, 255, 1) 0%, rgba(153, 190, 255, 1) 47%, rgba(140, 182, 255, 1) 100%) !important;; /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(177, 205, 255, 1)), color-stop(47%, rgba(153, 190, 255, 1)), color-stop(100%, rgba(140, 182, 255, 1))) !important; /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, rgba(177, 205, 255, 1) 0%, rgba(153, 190, 255, 1) 47%, rgba(140, 182, 255, 1) 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, rgba(177, 205, 255, 1) 0%, rgba(153, 190, 255, 1) 47%, rgba(140, 182, 255, 1) 100%) !important; /* Opera 11.10+ */ background: -ms-linear-gradient(top, rgba(177, 205, 255, 1) 0%, rgba(153, 190, 255, 1) 47%, rgba(140, 182, 255, 1) 100%) !important; /* IE10+ */ background: linear-gradient(to bottom, rgba(177, 205, 255, 1) 0%, rgba(153, 190, 255, 1) 47%, rgba(140, 182, 255, 1) 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b1cdff', endColorstr='#8cb6ff', GradientType=0); /* IE6-9 */ box-shadow: 0 5px 9px -6px #888 !important; border-radius: 0px 0px 2px 2px; /* top left, top right, bottom right, bottom left */ -webkit-border-radius: 0px 0px 2px 2px; -moz-border-radius: 0px 0px 2px 2px; } #headMenu .on, #headMenu .Homeon { background-color: #b1cdff !important; border-radius: 2px 2px 0px 0px !important; /* top left, top right, bottom right, bottom left */ -webkit-border-radius: 2px 2px 0px 0px !important; -moz-border-radius: 2px 2px 0px 0px !important; } .on-sticky { background: #b1cdff !important; float: left; height: 34px; background-image: none; background-repeat: no-repeat; background-position: 0px 20px; margin: 0; padding: 0; border-radius: 2px 2px 0px 0px !important; /* top left, top right, bottom right, bottom left */ -webkit-border-radius: 2px 2px 0px 0px !important; -moz-border-radius: 2px 2px 0px 0px !important; } .on-sticky a { font-weight: bold; color: #0c162f !important; padding: 10px 5px 11px 5px; } #headMenu li.off.on { background: #b1cdff url('http://static.ksl.com/header/header_graphics/home-button_on.png') 0 7px no-repeat; } #headMenu li.off.on img { visibility: hidden; } </style> <script type="text/javascript"> var kslHeaderMeta = { kslLinkPrefix: '/' }; </script> <!-- <script type="text/javascript" src="//static.ksl.com/header/header_includes/popOverMenu.js?cachebust=2"></script> --> <script type="text/javascript" src="//static.ksl.com/header/header_includes/tvRadioPopOver.js?cachebust=2"></script> <style type="text/css" media="screen">@import "//static.ksl.com/header/header_includes/navPopOver.css";</style> <style> #headBlock .bottom { height: 34px !important; } </style> <style type="text/css" media="screen">@import "//static.ksl.com/header/header.css";</style> <link rel="stylesheet" media="only screen and (max-device-width:480px)" href="//static.ksl.com/header/header_includes/navPopOver.css" type="text/css" /> <link rel="stylesheet" media="screen and (min-device-width:481 px)" href="//static.ksl.com/header/header_includes/navPopOver.css" /> <link type="text/css" rel="stylesheet" media="print" href="//static.ksl.com/header/header_includes/navPopOver.css" /> <link type="text/css" rel="stylesheet" media="handheld" href="//static.ksl.com/header/header_includes/navPopOver.css" /> <link type="text/css" rel="alternate stylesheet" href="//static.ksl.com/header/header_includes/navPopOver.css" title = "mobile"/> <!-- empty div for popOver --> <div id="tvRadioWindow"></div> <div id="headBlock"> <div class="Channels" data-vr-zone="HP Channels"> <span class="utility"> <span class="utility-login"><span class="utility-login-loggedin"><a href="/public/member/home" data-vr-contentbox="account details" title="View account details">Hello rm4453</a>&nbsp;|&nbsp;<a href="https://www.ksl.com/public/member/logout?login_forward=%2Findex.php%3Fnid%3D640%26form_3%3D16%26form_4%3D467" data-vr-contentbox="logout" title="Logout of ksl.com">Logout</a></span></span>&nbsp;&nbsp; <a href="//www.ksl.com/?sid=15956469&nid=322" data-vr-contentbox="" title="Leave feedback about your experience">Feedback</a>&nbsp;&nbsp; <a href="//www.ksl.com/index.php?nid=205" data-vr-contentbox="" title="Contact KSL Customer Support">Contact Us</a> </span> <!-- end utility --> <div style="float: left;" class="tvRadioPopOver" nid="15"> <a href="/?nid=15" data-vr-contentbox="KSL TV" alt="KSL TV">KSL TV</a>&nbsp; </div> <div style="float: left;"> <img style="margin-top: 3px; float: left; display: block;" src="//static.ksl.com/header/header_graphics/downArrow.png" border=0/>&nbsp;&nbsp;&nbsp; </div> <div style="float: left;" class="tvRadioPopOver" nid="16"> <a href="/?nid=16" alt="KSL Newsradio" data-vr-contentbox="KSL Newsradio">KSL Newsradio</a>&nbsp; </div> <div style="float: left;"> <img style="margin-top: 3px; float: left; display: block;" src="//static.ksl.com/header/header_graphics/downArrow.png" border=0/>&nbsp;&nbsp;&nbsp; </div> <div style="float: left;"> <a href="http://live.ksl.com/scheduler/embed-view" alt="KSL Mobile" style="color: #fff;" data-vr-contentbox="KSL Live">KSL Live!</a>&nbsp; </div> <div style="float: left;">&nbsp;&nbsp;&nbsp;</div> <div style="float: left;"> <a href="/?nid=1114" alt="KSL SHows" style="color: #fff;" data-vr-contentbox="KSL Shows">KSL Shows</a>&nbsp; </div> <div style="float: left;">&nbsp;&nbsp;&nbsp;</div> <div style="float: left;"> <a href="/?nid=1072" alt="iWitness" style="color: #fff;" data-vr-contentbox="iWitness">iWitness</a>&nbsp; </div> <div style="float: left;">&nbsp;&nbsp;&nbsp;</div> <div style="float: left;"> <a href="/?sid=17920249&nid=250" alt="KSL Mobile" style="color: #fff;" data-vr-contentbox="Mobile">Mobile</a>&nbsp; </div> <div style="float: left;"></div> </div> <!-- Channels --> <div class="middle"> <div class="logo"> <a href="/index.php?nid=210"><img src="//static.ksl.com/header/header_graphics/logo.png" border=0></a> </div> <!-- WX box --> <div class="titleBox"> <a href="/index.php?nid=13"><font style="color: #fff; font-size: 36px;"> &nbsp;&raquo;&nbsp;Classifieds</font></a> </div> <!-- End of WX box --> <!-- Search box --> <!-- Temporary JS to get search working --> <script type="text/javascript"> function selectSearch() { var searchMethod = $("#search_select").val(); var searchKeyword = $("#search_keyword").val(); if (searchMethod == 'news') { window.location.href = "/?sid=53574&nid=208&cx=partner-pub-3771868546990559%3Ar955z1-wmf4&cof=FORID%3A9&ie=ISO-8859-1&sa=Search&searchtype=kslcom&q=" + searchKeyword + "&x=15&y=19"; return false; } else if (searchMethod == 'keyword') { //$('#search_form').attr('action', '/?sid=53574&nid=208&cx=partner-pub-3771868546990559%3Ar955z1-wmf4&cof=FORID%3A9&ie=ISO-8859-1&sa=Search&searchtype=keyword&q=' + searchKeyword + '&x=11&y=16'); window.location.href = "/?sid=53574&nid=208&cx=partner-pub-3771868546990559%3Ar955z1-wmf4&cof=FORID%3A9&ie=ISO-8859-1&sa=Search&searchtype=keyword&q=" + searchKeyword + "&x=11&y=16"; return false; } else if (searchMethod == 'classifieds') { window.location.href = "/index.php?nid=231&search=" + searchKeyword; return false; } else if (searchMethod == 'local') { window.location.href = "http://local.ksl.com/search/keyword/" + searchKeyword + "/location/Salt+Lake+City%2C+UT+84101"; return false; } else if (searchMethod == 'web') { window.location.href = "/?sid=53574&nid=208&cx=partner-pub-3771868546990559%3Afhkopy-oe3c&cof=FORID%3A9&ie=ISO-8859-1&sa=Search&searchtype=web&q=" + searchKeyword + "&x=0&y=0"; return false; } return false; } </script> <!-- END Temporary JS to get search working --> <form id="search_form" action="" method="get" onSubmit="return selectSearch();"> <div class="searchBox"> <input type="image" src="//static.ksl.com/header/header_graphics/search-magnify.png" class="button"/> <span class="dropdown"> <select id="search_select" class="dropdownMenu"> <option value="news">all of KSL</option> <option value="classifieds">Classifieds</option> <option value="local">Local</option> <option value="web">Web</option> <option value="keyword">Keyword</option> </select> </span> <input type="text" name="search" id="search_keyword" class="searchField" value="Enter Keyword" onclick="this.value = ''"/> </div> </form> <!-- End of Search box --> </div> <!-- middle --> <!-- Main Nav --> <div class="bottom"> <div id="headMenu" data-vr-zone="Head Menu"> <ul> <li class="off" nid="210"><a href="/index.php?nid=210" style=" padding: 0px 0px 10px 0px; background: none !important; height: auto; width: 100%;" data-vr-contentbox=""> <img src="//static.ksl.com/header/header_graphics/home-button.png" border=0> </a></li> <li class="navHover" nid="30"><a href="/index.php?nid=30" data-vr-contentbox=""> Utah </a></li> <li class="navHover" nid="998"><a href="/index.php?nid=998" data-vr-contentbox=""> Features </a></li> <li class="navHover" nid="31"><a href="/index.php?nid=31" data-vr-contentbox=""> U.S. </a></li> <li class="navHover" nid="32"><a href="/index.php?nid=32" data-vr-contentbox=""> World </a></li> <li class="navHover" nid="599"><a href="/index.php?nid=599" data-vr-contentbox=""> Politics </a></li> <li class="navHover" nid="115"><a href="/index.php?nid=769" data-vr-contentbox=""> Sports </a></li> <li class="navHover" nid="88"><a href="/?nid=88" data-vr-contentbox=""> Weather </a></li> <li class="navHover" nid="710"><a href="/index.php?nid=710" data-vr-contentbox=""> Traffic </a></li> <li class="navHover" nid="116"><a href="/index.php?nid=116" data-vr-contentbox=""> Biz </a></li> <li class="navHover" nid="11"><a href="/index.php?nid=11" data-vr-contentbox=""> Entertainment </a></li> <li class="navHover" nid="1168"><a href="/?nid=1287" data-vr-contentbox=""> Outdoors </a></li> <li class="navHover" nid="1267"><a href="/index.php?nid=1267" data-vr-contentbox=""> BrandView </a></li> </ul> </div> <div id="headclassifiedMenu" data-vr-zone="Marketplace Nav"> <ul> <li><a href="https://shops.ksl.com" data-vr-contentbox="" title="" style="position: relative;">Shops <div class="beta">Beta</div></a></li> <li><a href="/deals" data-vr-contentbox="" title="View today's discounts and deals">Deals</a></li> <li><a href="//local.ksl.com/" data-vr-contentbox="" title="Find Coupons & Discounts from Local Businesses">Local</a></li> <li ><a href="/jobs/" data-vr-contentbox="">Jobs</a></li> <li ><a href="/homes" data-vr-contentbox="">Homes</a></li> <li ><a href="/auto" data-vr-contentbox="">Cars</a></li> <li class="off"><a href="/index.php?nid=13" data-vr-contentbox="">Classifieds</a></li> </ul> </div> <!-- headclassifiedMenu --> </div> <!-- bottom --> </div> <!-- headBlock --> <!-- empty div for popOver --> <div id="popOverWindow"></div> <script> var SCROLL_OUT_DELAY = 500; var scrollTimer; var HOME_NID = '640' || 210; var PARENT_NID = '640' || 210; var activeNid = HOME_NID; var links = jQuery.parseJSON('[{"nid":"210","children":[]},{"nid":"30","children":[{"href":"\/index.php?nid=148","name":"Local Stories"},{"href":"\/index.php?nid=680","name":"Education"},{"href":"\/index.php?nid=308","name":"KSL Investigates"},{"href":"\/index.php?nid=1174","name":"Your Life - Your Health"},{"href":"\/index.php?nid=694","name":"Staying Safe"},{"href":"\/index.php?nid=1196","name":"More on the web"}]},{"nid":"998","children":[{"href":"\/index.php?nid=999","name":"Family"},{"href":"\/index.php?nid=1008","name":"HYST?"},{"href":"\/index.php?nid=1285","name":"Uplifting"},{"href":"\/index.php?nid=1000","name":"Lifestyle"},{"href":"\/index.php?nid=1287","name":"Outdoors &amp; Rec"},{"href":"\/index.php?nid=1007","name":"Religion"},{"href":"\/index.php?nid=1283","name":"LDS Life"},{"href":"\/index.php?nid=1002","name":"Science &amp; Tech"},{"href":"\/index.php?nid=333","name":"Odds &amp; Ends"},{"href":"\/index.php?nid=1072","name":"iWitness"},{"href":"\/index.php?nid=1358","name":"Initiatives"}]},{"nid":"31","children":[]},{"nid":"32","children":[]},{"nid":"599","children":[]},{"nid":"115","children":[{"href":"?nid=774","name":"BYU"},{"href":"?nid=827","name":"UofU"},{"href":"?nid=862","name":"Jazz"},{"href":"?nid=859","name":"USU"},{"href":"?nid=854","name":"RSL"},{"href":"?nid=853","name":"Prep"},{"href":"\/index.php?nid=1150","name":"SUU"},{"href":"\/index.php?nid=1151","name":"Weber"},{"href":"\/index.php?nid=1251","name":"UVU"},{"href":"\/index.php?nid=259","name":"Pickem"},{"href":"http:\/\/ksl.sportsdirectinc.com\/gamematchups.aspx","name":"Stats\/Scores"},{"href":"?nid=1356","name":"More"}]},{"nid":"88","children":[{"href":"http:\/\/www.ksl.com\/index.php?nid=1255","name":"Home"},{"href":"\/index.php?nid=525","name":"Current Conditions"},{"href":"\/index.php?nid=175","name":"VORTEX"},{"href":"\/index.php?nid=233","name":"MicroCast"},{"href":"?sid=35584527&nid=149","name":"Pollen Count"},{"href":"\/index.php?nid=340","name":"Junior Weather Specialists"},{"href":"?sid=128553&nid=522","name":"Ski Report"},{"href":"\/index.php?nid=524","name":"Weather Cams"},{"href":"?nid=580","name":"Water Watch"},{"href":"\/index.php?nid=978","name":"Snowpack"},{"href":"\/index.php?nid=1311","name":"myAir"},{"href":"\/index.php?nid=1314","name":"Air Quality"}]},{"nid":"710","children":[{"href":"?nid=710","name":"KSL Traffic Center"}]},{"nid":"116","children":[]},{"nid":"11","children":[{"href":"http:\/\/movies.ksl.com","name":"Movie Reviews &amp; Listings"},{"href":"\/index.php?nid=1204","name":"Entertainment News"}]},{"nid":"1168","children":[{"href":"http:\/\/outdoors.ksl.com\/","name":"Outdoors Activity Map"},{"href":"http:\/\/www.ksl.com\/index.php?nid=1113&sid=17217040&title=ksl-outdoors-with-adam-eakle","name":"KSL Outdoors with Adam Eakle"}]},{"nid":"1267","children":[{"href":"\/index.php?nid=1300","name":"Young Automotive Auto Review"},{"href":"\/index.php?nid=1306","name":"UofU Health Feed"},{"href":"\/index.php?nid=1332","name":"Green Tea HP"},{"href":"\/index.php?nid=1339","name":"Mountain America Money Matters"},{"href":"\/index.php?nid=1351","name":"MountainStar HealthShare"},{"href":"\/index.php?nid=1371","name":"UCAIR"},{"href":"\/index.php?nid=1375","name":"Zero Fatalities"},{"href":"\/index.php?nid=1379","name":"Salt Lake Regional Medical Center"},{"href":"\/index.php?nid=1381","name":"Broadway at the Eccles"}]},{"nid":"13","children":[{"href":"\/index.php?nid=47","name":"Browse Ads"},{"href":"\/index.php?nid=443","name":"Cars"},{"href":"?sid=5017903&nid=651","name":"Homes"},{"href":"\/jobs\/listings","name":"Jobs"},{"href":"\/index.php?sid=&nid=793","name":"Services"},{"href":"\/index.php?nid=640","name":"Place a FREE Ad"},{"href":"http:\/\/www.ksl.com\/index.php?nid=443&sid=733005&tab=post","name":"Place a FREE Car Ad"},{"href":"\/index.php?nid=280","name":"My Ads"},{"href":"\/index.php?nid=385","name":"Advanced Search"},{"href":"\/index.php?nid=207","name":"Help"}]}]'); var linksMap = jQuery.parseJSON('["210","30","998","31","32","599","115","88","710","116","11","1168","1267",640]'); if ($.inArray(parseInt(HOME_NID), linksMap) < 0) { HOME_NID = parseInt($("#headMenu li.on-sticky").attr("nid")) || 210; } for (var i = 0, len = linksMap.length; i < len; i++) { linksMap[i] = parseInt(linksMap[i]); } function subNavRow(links) { var panel = ''; if (!('children' in links)) { links.children = []; } for (var i = 0, len = links.children.length; i < len; i++) { panel += '<li><a href="' + links.children[i].href + '">' + links.children[i].name + '</a></li>'; } return panel; } function getSubNav(nid) { nid = parseInt(nid); activeNid = nid; var _links = void 0; var index = $.inArray(nid, linksMap); if (index >= 0) { _links = links[index]; } else { var _nid = $("#headMenu .on").attr("nid") || 0; _nid = parseInt(_nid); if (_nid <= 0) { _links = []; } else if ($.inArray(_nid, linksMap) >= 0) { _links = links[$.inArray(_nid, linksMap)]; } } var html = subNavRow(_links); $("#navBlock #navMenu ul").html(html); } function onMouseOver(event) { event.preventDefault(); clearTimeout(scrollTimer); var nid = $(this).parent().attr("nid"); getSubNav(nid); } function onMouseOverSub(event) { event.preventDefault(); clearTimeout(scrollTimer); $("#headMenu li[nid]").removeClass("on"); $("#headMenu li[nid='" + activeNid + "']").addClass("on"); } function onMouseOut(event) { event.preventDefault(); scrollTimer = setTimeout(function () { getSubNav(HOME_NID); activeNid = HOME_NID; $("#headMenu li[nid]").removeClass("on"); }, SCROLL_OUT_DELAY); } $("#headMenu").on("mouseover", "li[nid] a", onMouseOver); // These registrations *must* be rooted on body because that's [currently] the nearest ancestor // attached to the DOM by the time this code is executed. #headMenu and #navBlock don't get // attached until after this code executes. $("body").on("mouseover", "#headMenu li, #navBlock", onMouseOverSub); $("body").on("mouseout", "#headMenu li, #navBlock", onMouseOut); setTimeout(function () { getSubNav(HOME_NID); $("#navMenu a[href*='nid=640']").addClass("active"); }, 100); </script> <div id="mainoutsideBlock"> <div id="mainBlock"> <div id="navBlockorange"> <!-- .................... Block: subNavBar .................... --> <div id="navMenuorange"> <ul> <li><a href="/?nid=47">Classifieds</a></li> <li><a href="/auto">Cars</a></li> <li><a href="/homes">Homes</a></li> <li><a href="/jobs/">Jobs</a></li> </ul> <ul style="float: right; margin-top: 0px; margin-right: 5px;"> <li><a href="/?nid=385">Advanced Search</a></li> <li><a href="/?nid=207">Help</a></li> <li><a href="/myAds/listing-classified">My Ads</a></li> <li class="on"> <a class="placeAdHover" href="/?nid=1126" style="">Place an Ad <img style="margin-bottom: -3px;" height="8" width="8" src="/images/classifieds/placeAdArrow.jpg" border="0" /></a> </li> </ul> </div> <!-- navMenu --> <!-- Place an Ad popOver --> <div id="popOverWindow"></div> <!--[if IE]> <style type="text/css"> #placeAdDropdown { margin-right: -492px; } .placeAdHover { margin-top: -5px; } </style> <![endif]--> <script type="text/javascript" src="/javascript/placeAdPopOver.js?cachebust=2"></script> <!-- <div id="placeAdDropdown" style="position: absolute; right: 172px; top: 23px; display: none; width: 70px; height: 53px; /* left: 1043px;*/ background-color: #f7941d; z-index: 99;"> --> <div id="placeAdDropdown" > <!-- <a href="/?nid=1126" style="color: white; margin-bottom: 5px; margin-left: 5px; margin-top: 5px;">Classified</a><br /> --> <a href="/?nid=1126" style="color: white; margin: 5px;">Classified</a><br /> <a href="/auto/sell" style="color: white; margin: 5px;">Car</a><br /> <a href="http://local.ksl.com/merchant/list/look-up" style="color: white; margin: 5px;" >Business</a><br /> <a href="/jobs/edit" style="color: white; margin: 5px;" >Job</a><br /> <a href="/homes/sell/sell-choice" style="color: white; margin: 5px;">Home</a> </div> <!-- End Place Ad PopOver --> </div> <!-- navBlock --> <div id="bodyBlock"> <!-- .................... Block: column1 .................... --> <div id="bodyCol1"> <div style="width: 424px; float: left; margin: 0px 0px 10px 0px;"> <style type='text/css'> .announcement_box { float: left; clear:left; margin: 0px 0px 20px 0px; background: #eee; width: 615px; padding: 10px; font-size: 14px; font-weight: bold; } .announcement_box a { text-decoration:none; } </style> <div class="announcement_box"> <font color="#aa0000">UPDATE:</font> Services is now part of <a href="http://local.ksl.com/?s_cid=services">KSL Local</a> with more categories and added features.<br /> To take full advantage of KSL Local be sure to <a href="http://local.ksl.com/merchant/locations">add your business</a> today. Service ads posted outside of KSL Local will be deleted.<br /> </div> <div style='clear: both;'></div> </div> <div style="width: 424px; float: left; margin: 0px 0px 10px 0px;"> <!-- Hack --> <script type="text/javascript"> $(document).ready( function() { $('#3').attr('disabled', 'disabled'); $('#4').attr('disabled', 'disabled'); $('.element:eq(3)').append( ' <a href="index.php?nid=1126">Change »</a>' ); $('.element:eq(4)').append( ' <a href="index.php?nid=1126">Change »</a>' ); } ); </script> </div> <div id="bodyCol2"> <!-- ===================[ STORY PAGES ]================= --> <!-- ===================[ STORY MEDIA ]================= --> <!-- ===================[ STORY RELATED ]================= --> <!-- ===================[ STORY RELATED ]================= --> <!-- ===================[ STORY GALLERIES ]================= --> </div> <script language="JavaScript" type="text/javascript"> function addInputs() { var oNewNode = document.createElement("div"); oNewNode.setAttribute("style","padding-top: 5px;"); document.getElementById('attr_fields').appendChild(oNewNode); oNewNode.innerHTML="<input type=\"text\" name=\"text[]\" id=\"text[]\" size=\"25\" \/>"; // document.getElementById('attr_fields').innerHTML="<input type=\"text\" name=\"text[]\" id=\"text[]\" size=\"25\" \/>"; } var mediaCount = 0; // ================================================================ function addMedia(ctrlID,divID,inputName,limit) { var name = "media_"+mediaCount; var oNewNode = document.createElement("div"); oNewNode.setAttribute("style","padding-top: 3px;"); oNewNode.setAttribute("id",name); document.getElementById(divID).appendChild(oNewNode); oNewNode.innerHTML="<input name=\""+inputName+"[]\" type=\"file\" /> <a href=\"#\" onClick=\"delMedia('"+ctrlID+"','"+name+"')\">Remove</a>"; mediaCount++; if (document.getElementById(divID).childNodes.length >= limit) { document.getElementById(ctrlID).style.display = "none"; } // document.getElementById('attr_fields').innerHTML="<input type=\"text\" name=\"text[]\" id=\"text[]\" size=\"25\" \/>"; } // ================================================================ function delMedia(ctrlID,name) { var oNode = document.getElementById(name); oNode.parentNode.removeChild(oNode); mediaCount--; document.getElementById(ctrlID).style.display = "block"; } var subName; // ================================================================ function setCat(cName,sName,col,tId) { var sNode = document.getElementById(sName); var cIndex = document.getElementById(cName).selectedIndex; var cValue = document.getElementById(cName).options[cIndex].value; //alert(cValue); //sNode.style.background = "#ddd"; sNode.options[1] = new Option("[Loading Options]", "", false, false); sNode[1].selected = true; subName = sName; $('#throbber-'+subName).css('display','inline'); //document.getElementById("rmiCmd").src = "/scripts/cat_options.php?col="+col+"&tid="+tId+"&nid="+cValue; $.get('/scripts/cat_options2.php', { col: col, tid: tId, nid: cValue }, setSub2, 'json'); } // ================================================================ function setSub2(d) { var sub = $('#'+subName); $('#throbber-'+subName).css('display','none'); if(d.result == 'error') return; //sub.css('background-color','#ffffff'); sub.empty(); sub.append('<option value="">Select a Sub-Category</option>'); for(i in d.categories) { var v = d.categories[i].split('|'); sub.append('<option value='+v[0]+'>'+v[1]+'</option>'); } } // ================================================================ function setSub(doc) { var sNode = document.getElementById(subName); var rmiData = doc.getElementById('rmiData').innerHTML; var aItems = rmiData.split("|"); var aVals; sNode.style.background = "#fff"; //var tNode = document.getElementById("id_text"); //tNode.value = rmiData; for (var x = 0; x < (aItems.length -1); x ++) { aVals = aItems[x].split("="); sNode.options[x+1] = new Option(aVals[1],aVals[0],false,false); } sNode.length = x+1; sNode[0].selected = true; } // ================================================================ function start_upload(id) { $('#d-'+id).css('background-color', '#ccc'); $('.throbber').css('display', 'inline'); } // ================================================================ function stop_upload(id, src, desc, alt) { var html = ''; var idx = $('#u-'+id+' div.photo').length; if(src == false) { alert("Error: "+desc); } else { html = '<div class="photo"><div class="operations"><button class="photo-up" onclick="photo_up(this)">Move up</button> <button class="photo-down" onclick="photo_down(this)">Move down</button> <button class="photo-delete" onclick="photo_delete(this)">Delete</button></div><img class="thumbnail" src="'+src+'?filter=ksl/newhl"><div class="title"><span class="title-prefix">Photo:</span> '+alt+'</div><div><span class="title-prefix">Description:</span> <span class="description">'+desc+'</span></div><div><button class="photo-edit" onclick="photo_edit_description(this)">Edit description</button></div></div>'; $('#u-'+id).append(html); } // clear the form $('#d-'+id).css('background-color', 'white'); $('#f-'+id).get(0).reset(); $('.throbber').css('display', 'none'); } // ================================================================ function photo_up(e) { var src = $(e).parent().parent(); var dst = $(src.prev()); if(dst.length == 0) return; var srcidx = src.prevAll().length; var dstidx = srcidx-1; // perform API call $.post('/resources/form/airlock_api.php', { cmd: 'move_media', source: 'airlock', aid: '71632824', from: srcidx, to: dstidx }, function (d) { if(d.result != 'success') return; $(src).insertBefore(dst); }, 'json' ); } // ================================================================ function photo_down(e) { var src = $(e).parent().parent(); var dst = $(src.next()); if(dst.length == 0) return; var srcidx = src.prevAll().length; var dstidx = srcidx+1; // perform API call $.post('/resources/form/airlock_api.php', { cmd: 'move_media', source: 'airlock', aid: '71632824', from: srcidx, to: dstidx }, function (d) { if(d.result != 'success') return; $(src).insertAfter(dst); }, 'json' ); } // ================================================================ function photo_delete(e) { var src = $(e).parent().parent(); var index = src.prevAll().length; // perform API call $.post('/resources/form/airlock_api.php', { cmd: 'delete_media', source: 'airlock', aid: '71632824', index: index }, function (d) { if(d.result != 'success') return; src.remove(); }, 'json' ); } // ================================================================ function photo_edit_description(e) { var src = $(e).parent().parent(); var index = src.prevAll().length; var desc = src.find('.description'); var odesc = desc.text(); var ndesc = prompt('Please enter the description for the photo:', odesc); if(ndesc == null) return; // perform API call $.post('/resources/form/airlock_api.php', { cmd: 'edit_media', source: 'airlock', aid: '71632824', index: index, desc: ndesc }, function (d) { if(d.result != 'success') return; desc.text(ndesc); }, 'json' ); } // ================================================================ function supports_html5_storage() { try { return 'localStorage' in window && window['localStorage'] !== null; } catch (e) { return false; } } // ================================================================ function send_id() { //20110427 - BH //this causes double posting in the classifieds, as it resubmits anything in the airlock a second time. return; var id; if(!supports_html5_storage()) return; id = localStorage.getItem('ddmId'); if(id == null) { id = Math.round(Math.random()*10000000); localStorage.setItem('ddmId', id); } $.post('/resources/form/airlock_api.php', { cmd: 'set_id', source: 'airlock', aid: '71632824', id: id}, function(){}, 'json' ); } // ================================================================ $(document).ready(function(){ send_id(); }); </script> <style type="text/css"> .barBox { clear: left; margin-left: 0px; font-size: 14px; color: #fff; font-weight: normal; text-align: center; border-left: 1px solid #000; border-right: 1px solid #000; height: 21px; width: 620px; } .bar1 { float: left; background: url('/images/barBackRed.gif') no-repeat top right; height: 21px; } .bar2 { float: left; background: url('/images/barFrontRed.gif') no-repeat top right; height: 21px; } .bar3 { float: left; background: url('/images/barBackGrey.gif') no-repeat top right; height: 21px; } .bar4 { float: left; background: url('/images/barBackGrey.gif') no-repeat top left; height: 21px; } .bar5 { float: left; background: url('/images/barFrontRed.gif') no-repeat top left; height: 21px; } .barLabels { clear: left; margin-left: 10px; font-weight: bold; text-align: center; height: 21px; width: 332px; color: #666; padding-top: 5px; font-size: 12px; } .barBottom { float: left; height: 40px; text-align: left; } .barText { position: relative; top: 4px; left: -6px; } .formDivider { clear: left; width: 620px; border-top: 1px solid #ccc; background: #eeeeee; margin-top: 10px; margin-bottom: 15px; height: 20px; font-size: 14px; font-weight: bold; padding: 3px 0px 0px 7px; } .imageBox { float: left; margin-top: 5px; margin-bottom: 5px; margin-right: 10px; } .help { font-size: 10px; } .boxOk { margin-top: 4px; } .boxErr { margin-top: 4px; background: #fbb; border: 1px solid #900; padding: 2px; } .boxStatic { margin-top: 4px; font-weight: bold; font-size: 14px; } .optionBox { margin-top: 3px; margin-bottom: 8px; } .submitBox { clear: both; margin: 5px 0px 0px 2px; } .element { clear: left; width: 585px; margin-bottom: 3px; padding: 0px; } .elementFloat { float: left; margin-right: 10px; margin-bottom: 4px; } .iLabel { float: left; display: block; font-weight: normal; padding: 0px; margin: 4px 0px 0px 5px; text-align: left; font-size: 12px; width: 120px; } .gBox { width: 625px; margin: 0px 0px 15px 0px; padding: 0px; overflow: hidden; } .gTitle { font-size: 18px; font-weight: bold; padding: 5px 0px 5px 0px; width: 620px; border-top: 1px solid #ccc; margin: 0px 0px 12px 0px; } .gBody { padding: 0px 15px 5px 20px; width: 590px; } iframe.uploader { display: none; width: 0; height: 0; } /*iframe.uploader { display: block; width: 400px; height: 300px; }*/ .photos { margin-left: 5px; clear: both; } .operations { float: right; } .operations span { color: blue; } .photos div.photo { min-height: 77px; height: 77px; margin-bottom: 8px; padding-bottom: 9px; padding-top: 2px; border-bottom: dashed #ccc 1px; } .photos input { font-size: 10px; } .photos img { float: left; margin-right: 10px; } .photos .title-prefix { font-weight: bold; } .photos button { background-color: #e6e6e6; border: solid #aaa 1px; font-size: 80%; -moz-border-radius: 3px; -webkit-border-radius: 3px; } .photos button:hover { color: white; background-color: #0073ea; border: solid #0073ea 1px; } .photos button.photo-edit { margin-top: 3px; } .photos .thumbnail { width: 100px; height: 75px; } .throbber { display: none; } #HomeDetails { display: none; } </style> <div style='clear: both;'></div> <div class="gBox"> <div style="float:left; font-size: 14px; font-weight: bold; color: #777; margin: 0px 0px 2px 0px;">KSL Classifieds - Utah's Fastest Growing Classifieds Website</div> <div style="clear:left; font-size: 20px; font-weight: bold; margin: 0px 0px 10px 0px;">Place a FREE Classified Ad</div> <div style=" margin: 0px 0px 10px 0px; "> <div class="barBox"> <div class="bar1" style="width: 137px;"><span class="barText"><span style="font-size: 11px;">Create the Ad</span></span></div> <div class="bar1" style="width: 124px;"><span class="barText"><span style="font-size: 11px;">Contact Info</span></span></div> <div class="bar2" style="width: 124px;"><span class="barText"><span style="font-size: 11px;">Add Photos</span></span></div> <div class="bar3" style="width: 124px;"><span class="barText"><span style="font-size: 11px;">Terms of Use</span></span></div> <div class="bar4" style="width: 111px;"><span class="barText"><span style="font-size: 11px;">Thank You</span></span></div> </div> </div> <div id=""> <div id="" class="gBody"> </div> </div> <div id="PhotoUpload"> <div class="gTitle">Photo Upload</div> <div id="PhotoUpload" class="gBody"> <div class="element"> <p> <b>Note:</b> The first photo will be used as the primary photo and will represent your ad in the listings, so make sure it's the best photo you have. Use the buttons to the right of each image to change the ordering. </p> <br> </div> <div class="element"> <div id="u-142" class="photos"> </div> <form id="f-142" method="post" enctype="multipart/form-data" action="/resources/form/upload.php" onsubmit="start_upload(142)"> <input type="hidden" name="nid" value="640" /> <input type="hidden" name="sid" value="4516794" /> <input type="hidden" name="fid" value="191336" /> <input type="hidden" name="source" value="airlock" /> <input type="hidden" name="aid" value="71632824" /> <label for="142" class="iLabel">File:</label> <input type="hidden" name="MAX_FILE_SIZE" value="10000000" /> <input id="142" name="142" type="file" class="boxOk" /><br/> </div> <div class="element"> <label for="d-142" class="iLabel">Description:</label> <textarea name="d-142" class="boxOk" id="d-142" wrap="soft" style="width: 400px; height: 50px;"></textarea> </div> <div class="element"> <label for="s-142" class="iLabel"></label> <input id="s-142" name="s-142" type="submit" value="Upload file" /> <img class="throbber" src="/graphics/throbber.gif" height="16" width="16"> <br/> <iframe id="i-142" name="i-142" class="uploader" src=""> </iframe> </form> <script type="text/javascript"> //$(document).ready(function () { $('#f-142').submit(function () { $('#f-142').attr('target','i-142'); }); //}); </script> </div> </div> </div> <div id="PhotoTips"> <div class="gTitle">Photo Tips</div> <div id="PhotoTips" class="gBody"> <div class="element"> <div style="padding-bottom: 7px; padding-left: 15px;"> <li>Submitted images must be in JPG or GIF format.</li> <li>Although all submitted images will automatically be resized to <span style="font-weight: bold;">640x480</span> pixels, we recommend resizing your images to these dimensions before you upload them to avoid any potential problems. Click <a href=http://www.ksl.com/?nid=391&sid=651805 target="_new">HERE</a> for instructions on how to do this.</li> <li>If resizing your images, as recommended above, does not help, then try submitting the ad with no images and then add the rest later using the edit function in "My Ads".</li> </div> </div> </div> </div> </div> <form method="post" action="/index.php?nid=640&form_3=16&form_4=467" enctype="multipart/form-data" /> <input type="hidden" name="nid" value="640" /> <input type="hidden" name="sid" value="4516794" /> <input type="hidden" name="fid" value="191336" /> <div class="submitBox"> <input type="submit" value="&lt;&lt; Back Page" name="back" class="submitBox" /> <input type="submit" value="Next Page &gt;&gt;" name="next" class="submitBox" /> </div> </form> <style type="text/css"> .mediaright { float: right; margin-left: 15px; margin-bottom: 3px; width: 202px; } .medialeft { float: left; margin-right: 30px; margin-bottom: 3px; width: 202px; } .sidebarright { float: right; width: 180px; border-bottom: 1px #ccc solid; color: #000; font-size: 12px; margin: 0px 0px 10px 10px; padding: 0px 0px 7px 0px; } .sidebarleft { float: left; width: 180px; border-bottom: 1px #ccc solid; color: #000; font-size: 12px; margin: 0px 10px 10px 0px; padding: 0px 0px 7px 0px; } .sidebarleft ul { margin: 0px 0px 0px 0px; padding: 0px 0px 0px 30px; } .sidebarright ul { margin: 0px 0px 0px 0px; padding: 0px 0px 0px 30px; } .divboxleft { float: left; margin-right: 15px; margin-bottom: 3px; width: 202px; font-size: 12px; padding: 6px; border: solid 1px black; } .divboxright { float: right; margin-left: 15px; margin-bottom: 3px; width: 202px; font-size: 12px; padding: 6px; border: solid 1px black; } .divboxleft ul { margin: 0px 0px 0px 10px; padding: 5px 0px 5px 15px;overflow: auto; } .divboxright ul { margin: 0px 0px 0px 10px; padding: 5px 0px 5px 15px;overflow: auto; } .divboxleft font { font-size: 11px; } .divboxright font { font-size: 11px; } .ksltableleft { float: left; margin-right: 15px; margin-bottom: 10px;margin-top: 5px;font-size: 11px; } .ksltableright { float: right; margin-left: 15px; margin-bottom: 10px;margin-top: 5px;font-size: 11px; } .ksltable { border-collapse:collapse; } .ksltable td, .ksltable th { font-size:11px; border:1px solid black; padding:3px 7px 2px 7px; text-align: center; } .ksltable th { font-size:12px; text-align:center; font-weight: bold;padding-top:5px; padding-bottom:4px; background-color:#0b162f; color:#fff; } span#widgetclose:hover { cursor: pointer; } </style> <!-- ===================[ STORY HEAD : INTRO ]================= --> <div id="storyIntro" > </div> <!-- HERE HERE --> <!-- Google Analytics --> <script> (function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-70949446-4', 'auto'); ga('send', 'pageview'); </script> </div> <!-- sid 17555887 = rentler place an ad page --> <div id="bodyCol3"> <div id="video-companion-2"></div> <div class="ad_block"> <div data-cb-ad-id="Default 0"> <div id='div-gpt-ad-1458596221-0' style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; z-index:-1;"></div> </div> <div style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; text-align: right; z-index:-1;"> <div style="font-size: 9px; "> <link rel="stylesheet" href="/packages/jquery-ui/v1.10.2/jquery-ui-1.10.2.custom.min.css" type="text/css" media="screen" title="no title" charset="utf-8"/> <script type="text/javascript" src="//static.ksl.com/packages/jquery-ui/v1.10.2/jquery-ui-1.10.3.custom.min.js"></script> <script type="text/javascript" src="//static.ksl.com/javascript/report_ad_gpt.js"></script> <a href="http://ads.ksl.com/" style="color: #8f94a0; float: left;">Advertise with us</a> <a href="#" onClick="aboutpop(this)" style="color: #8f94a0; float: right;">Report this ad</a> </div> </div> </div> <div style="clear:both; margin: 0px 0px 15px 0px;"></div> <div class="ad_block"> <div data-cb-ad-id="Default 1"> <div id='div-gpt-ad-1458596221-1' style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; z-index:-1;"></div> </div> <div style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; text-align: right; z-index:-1;"> <div style="font-size: 9px; "> <link rel="stylesheet" href="/packages/jquery-ui/v1.10.2/jquery-ui-1.10.2.custom.min.css" type="text/css" media="screen" title="no title" charset="utf-8"/> <a href="http://ads.ksl.com/" style="color: #8f94a0; float: left;">Advertise with us</a> <a href="#" onClick="aboutpop(this)" style="color: #8f94a0; float: right;">Report this ad</a> </div> </div> </div> <div style="clear:both; margin: 0px 0px 15px 0px;"></div> <div class="ad_block"> <div data-cb-ad-id="Default 2"> <div id='div-gpt-ad-1458596221-2' style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; z-index:-1;"></div> </div> <div style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; text-align: right; z-index:-1;"> <div style="font-size: 9px; "> <link rel="stylesheet" href="/packages/jquery-ui/v1.10.2/jquery-ui-1.10.2.custom.min.css" type="text/css" media="screen" title="no title" charset="utf-8"/> <a href="http://ads.ksl.com/" style="color: #8f94a0; float: left;">Advertise with us</a> <a href="#" onClick="aboutpop(this)" style="color: #8f94a0; float: right;">Report this ad</a> </div> </div> </div> <div style="clear:both; margin: 0px 0px 15px 0px;"></div> </div> <div class="headlineQueueHeadcol1wide" style="width: 984px;"> Site Index </div> <div class="nocontent"> <table width="984" border="0" class="siteIndex nocontent"> <tr valign="top"> <td width="164"><h2><a href="/index.php?nid=10">News</a></h2> <ul><li> <a href="/index.php?nid=30">Utah</a> <ul><li><a href="/index.php?nid=30">News</a> <li> <a href="/index.php?nid=680"> Education</a> <li> <a href="/index.php?nid=308">KSL Investigates</a> <li> <a href="/index.php?nid=1174">Your Life Your Health</a> <li> <a href="/index.php?nid=694">Staying Safe</a> <li> <a href="/index.php?nid=1196">More on the web</a></ul> </ul> <ul><li> <a href="/index.php?nid=30">Page Two</a> <ul><li><a href="/index.php?nid=999">Family</a> <li> <a href="/index.php?nid=1285">Uplifting</a> <li> <a href="/index.php?nid=1000">Lifestyle</a> <li> <a href="/index.php?nid=1287">Outdoors & Recreation</a> <li> <a href="/index.php?nid=1007">Religion</a> <li> <a href="/index.php?nid=1283">LDS Life</a> <li> <a href="/index.php?nid=599">Politics</a> <li> <a href="/index.php?nid=1002">Science & Tech</a> <li> <a href="/index.php?nid=333"> Odds &amp; Ends</a> <li> <a href="/index.php?nid=1281">Gephardt Gets It!</a> <li> <a href="/index.php?nid=1072">iWitness</a> </ul> </ul> <li> <a href="/index.php?nid=31"> National</a> <li> <a href="/index.php?nid=32"> World</a> <li> <a href="/index.php?nid=116"> Biz/Finance</a> <li> <a href="/index.php?nid=1198">Consumer</a> </uL></td> <td width="164"><h2><a href="/index.php?nid=88">Weather</a></h2> <ul><li> <a href="/index.php?nid=88">Forecasts</a> <li> <a href="/index.php?sid=2289447&nid=525"> Current Conditions</a> <li> <a href="/index.php?nid=175"> VORTEX</a> <li> <a href="/index.php?nid=233"> Microcast</a> <li> <a href="/index.php?sid=&nid=580"> Water Watch</a> <ul><li> <a href="/index.php?nid=149&sid=134181">Snowpack totals</a> <li> <a href="/index.php?nid=581&sid=2658650">Ramp reports</a> <li> <a href="/index.php?nid=149&sid=3321269">Lawn Watering guide</a> <li> <a href="/index.php?nid=149&sid=215478">Flood/Water Flow</a></ul> <li> <a href="/index.php?sid=901157&nid=461"> Photo Galleries</a> <li> <a href="/index.php?sid=106058&nid=149"> Weather Planner</a> <li> <a href="/index.php?nid=340&sid=148077"> Weather Lab</a> <li> <a href="/index.php?nid=366&sid=174427"> Ask the Meteorologist</a> <li> <a href="/index.php?sid=128553&nid=522"> Ski Report</a> <li> <a href="/index.php?nid=656"> Weather on 5.3</a> </ul> <p> <h2><a href="/index.php?nid=710">Traffic</a></h2> <ul><li> <a href="/index.php?nid=710">Traffic Cams</a> </ul> <p> <h2><a href="/index.php?nid=710">Special Features</a></h2> <ul><li> <a href="/index.php?nid=295"> General Conference</a> </ul> </td> <td width="164"> <h2><a href="/index.php?nid=115">Sports</a></h2> <ul> <li> <a href="/index.php?nid=271"> BYU</a> <ul> <li> <a href="/index.php?nid=841&sid=13378103">Coach's Show</a> <li> <a href="/index.php?nid=497">Cougar Tracks</a> <li> <a href="/index.php?nid=868">My Cougar Stories</a> <li> </ul> <li> <a href="/index.php?nid=634">U of U</a> <ul> <li> <a href="/index.php?nid=839">Crimson Corner</a> </ul> <li> <a href="/index.php?nid=859">USU</a> <ul> <li> </ul> <li> <a href="/index.php?nid=637">Jazz/NBA</a> <ul><li> <a href="/index.php?sid=1591910&nid=497">Schedule</a> / <a href="/index.php?sid=1591910&nid=497">Stats</a> / <a href="/index.php?sid=1591910&nid=497">Standings</a> <li> <a href="/index.php?sid=1591910&nid=497">Blog</a> </ul> <li> <a href="/index.php?nid=854">RSL</a> <ul><li> <a href="/index.php?sid=1591910&nid=497">Schedule</a> / <a href="/index.php?sid=1591910&nid=497">Stats</a> / <a href="/index.php?sid=1591910&nid=497">Standings</a> <li> <a href="/index.php?sid=1591910&nid=497">Blog</a> </ul> <li> <a href="/index.php?nid=431">Prep</a> <ul><li> <a href="/index.php?sid=1591910&nid=497">Schedule / Scoreboard</a> / <a href="/index.php?sid=1591910&nid=497">Standings</a> <li> <a href="/index.php?sid=1591910&nid=497">KSL Coaches Poll</a> </ul> <li> <a href="/index.php?nid=140"> NFL</a> <li> <a href="/index.php?nid=377">Golf Utah</a> <li> <a href="/index.php?nid=937">Stats/Scores</a> <li> <a href="http://bleacherreport.com/salt-lake-city-sports">Bleacher Reports</a> </ul> <p> <h2><a href="http://movies.ksl.com"> Movies</a></h2> <ul><li> <a href="http://movies.ksl.com">Movie/Theater Listings</a></uL> </td> <td width="164"> <h2><a href="/index.php?nid=1114">Shows</a></h2> <ul> <li> <a href="http://studio5.ksl.com">Studio 5</a> <li> <a href="/index.php?nid=1113&sid=17217040&title=ksl-outdoors-with-adam-eakle">KSL Outdoors w/ Adam Eakle</a> <li> <a href="http://www.ksl.com/?sid=&nid=315&title=ksl-5-news-today">KSL 5 News Today</a> <li> <a href="/index.php?sid=23994024&nid=1193&title=the-browser-50---weekdays-at-1230-on-ksl-5">The Browser 5.0</a> <li> <a href="/index.php?nid=178">Utah's Morning News</a> <li> <a href="/index.php?nid=399">Doug Wright Show</a> <li> <a href="/index.php?nid=894">The Browser</a> <li> <a href="/index.php?nid=180">Utah's Afternoon News</a> <li> <a href="http://nightside.ksl.com/">Nightside Project</a> <li> <a href="/index.php?nid=399">KSL Movie Show</a> <li> <a href="/index.php?nid=186">KSL Outdoors</a> <li> <a href="/index.php?nid=183">KSL Greenhouse Show</a> <li> <a href="/index.php?nid=305">Matt Townsend Show</a> <li> <a href="/index.php?nid=185">KSL Travel Show</a></ul> <p> <h2><a href="/index.php?nid=13">Classifieds</a></h2> <ul><li> <a href="/index.php?nid=13">General</a> <li> <a href="/homes">Homes</a> <li> <a href="/auto">Cars</a> <li> <a href="http://www.ksl.com/jobs">Utah Jobs</a> <li> <a href="http://www.ksl.com/deals">Deals</a> <li> <a href="http://local.ksl.com/">Local</a> <li> <a href="/index.php?nid=207">Help</a></ul> <p> </td> <td width="164" > <h2><a href="/index.php?nid=15">TV</a></h2> <ul><li> <a href="/index.php?nid=38"> Bios</a> <li> <a href="/index.php?nid=42">Schedule</a> <li> <a href="/index.php?nid=239"> Contests</a> <li> <a href="/index.php?nid=1196"> More on the Web</a> <li> <a href="http://studio5.ksl.com/"> Studio 5</a></ul> <p> <h2><a href="/index.php?nid=16">Radio</a></h2> <ul><li> <a href="/index.php?nid=16"> Listen LIVE</a> <li> <a href="/index.php?nid=209"> Podcasts</a> <li> <a href="/index.php?sid=122030&nid=312"> Lineup</a> <li> <a href="/index.php?nid=317"> Bios</a> <li> <a href="/index.php?nid=311"> Shows</a> <li> <a href="/index.php?nid=318">Features</a> <ul><li> <a href="/index.php?sid=2359958&nid=189">Speaking on Biz</a> <li> <a href="/index.php?nid=191">Teacher Feature</a> <li> <a href="/index.php?sid=29384064&nid=303">Money Matters</a> <li> <a href="/index.php?sid=30155869&nid=256">Utah Gives Back</a></ul> <li> <a href="/index.php?nid=253">Contests</a> <li> <a href="/index.php?nid=318">Events</a></ul> </td> <td width="164" style="background: #eee; padding: 2px 0px 0px 4px;"> <h2><a href="http://ads.ksl.com/">Advertise with KSL</a></h2> <p> <h2>Other Resources</h2> <ul><li> <a href="/index.php?nid=205">Contact Us</a> / <a href="/index.php?nid=277">Phone Numbers</a> <li> <a href="http://ksl.applicantpro.com" target="_blank">Careers with KSL</a> <li> <a href="http://deseretdigital.applicantpro.com">Careers with DDM</a> <li> <a href="/index.php?nid=278">Web Resources</a> <li> <a href="/index.php?sid=5562812&nid=322">Charity Account Form</a> </ul> <p> <h2>Mobile</h2> <ul><li> <a href="http://m.ksl.com">ksl.com mobile</a> <li> <a href="/index.php?sid=17920249&nid=250">KSL mobile apps</a> <li> <a href="http://www.ksl.com/?sid=14578360&nid=971">text alerts</a> </ul> <p> <h2>Legal</h2> <ul><li> <a href="/index.php?sid=95313&nid=250">Terms of Use</a> <li> <a href="/index.php?nid=250&sid=95314">Privacy Statement</a> <li> <a href="/index.php?nid=250&sid=95315">DMCA Notice</a> <li> <a href="http://www.ksl.com/eeo/EEO_Public_File.pdf">EEO Public File Report</a> <li> <a href="https://stations.fcc.gov/station-profile/ksl-tv">FCC Public File</a> <li> <a href="/index.php?sid=10021371&nid=250">Closed Captioning Assistance</a></ul> <p> <h2>Sister Sites</h2> <ul> <li> <a href="http://fm100.com/">FM100</a> / <a href="http://www.1035thearrow.com/">Arrow 103.5</a> <li><a href="http://www.deseretnews.com/home">Deseret News</a> <li><a href="http://www.utah.com">Utah.com</a> <li><a href="http://deseretbook.com/">Deseret Book</a> </ul> <p> </td> </tr> </table> </div> <div style="clear: left; padding: 10px 0px 0px 0px;"></div> </div> <!-- ============== BOTTOM BANNER =============== --> <div id="bannerad" > </div> <!-- ============== BOTTOM NAV============ --> <div style="padding: 4px 0px 10px 0px; font-size: 9px; text-align: center;"> <div style="margin-left: 7px; margin-right: 7px; text-align: center; padding: 2px; margin-bottom: 3px;"> KSL's Children's Television Programming Reports, as well as its FCC public inspection file, are available for viewing during regular office hours at the KSL Broadcast House or <a href="https://stations.fcc.gov/station-profile/ksl-tv">online</a>. <br> The station representative who can assist a person with disabilities with issues related to the content of the public files is Mike Dowdle, available during regular office hours at <a href="mailto:closed_captioning@ksl.com">closed_captioning@ksl.com</a> and (801) 575-5555. </div> <div style="padding: 10px 0px 10px 0px;"> &copy; 2016 ksl.com | KSL Broadcasting Salt Lake City UT | Site hosted &amp; managed by Deseret Digital Media - a Deseret Media Company&nbsp;&nbsp;v13</div> <div style="padding: 0px 0px 0px 0px;"><img name="footer" src="/graphics/ksl11/footer.png" width="537" height="38" border="0" id="footer" usemap="#m_footer" alt="" /><map name="m_footer" id="m_footer"> <area shape="rect" coords="327,0,485,34" href="http://deseretmediacompanies.com/" target="_blank" alt="" /> <area shape="rect" coords="230,4,316,38" href="http://deseretdigital.com/" target="_blank" alt="" /> <area shape="rect" coords="146,5,219,38" href="http://www.ksl.com/index.php?nid=16" alt="" /> <area shape="rect" coords="62,5,133,38" href="http://www.ksl.com/index.php?nid=15" alt="" /> </map> </div> <div style="clear: both; margin: 0px; padding: 0px; height: 5px;"></div> </div> </div> <!-- Crazy Egg Start --> <script type="text/javascript"> setTimeout(function() { var a=document.createElement("script"); var b=document.getElementsByTagName("script")[0]; a.src=document.location.protocol+"//script.crazyegg.com/pages/scripts/0021/2728.js?"+Math.floor(new Date().getTime()/3600000); a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b) }, 1); </script> <!-- Crazy Egg End --> <script type="text/javascript" src="https://scdn.cxense.com/cx.js"></script> <script type="text/javascript"> (function() { var src = '//www.googletagservices.com/tag/js/gpt.js'; document.write('<scr' + 'ipt src="' + src + '" ></scr' + 'ipt>'); })(); (function() { var src = '//ksl-d3.openxenterprise.com/w/1.0/jstag?nc=6686-KSL_Classified'; document.write('<scr' + 'ipt src="' + src + '" ></scr' + 'ipt>'); })(); </script> <script type='text/javascript' > googletag.cmd.push(function() { googletag.defineSlot('/6686/ddm.ksl/Classifieds//PlaceaFREEAd', [[300, 250], [300, 600]], 'div-gpt-ad-1458596221-0').addService(googletag.pubads()).setTargeting('pos', 'right').setTargeting('tile', '1'); googletag.defineSlot('/6686/ddm.ksl/Classifieds//PlaceaFREEAd', [[300, 250], [300, 600]], 'div-gpt-ad-1458596221-1').addService(googletag.pubads()).setTargeting('pos', 'right2').setTargeting('tile', '2'); googletag.defineSlot('/6686/ddm.ksl/Classifieds//PlaceaFREEAd', [[300, 250], [300, 600]], 'div-gpt-ad-1458596221-2').addService(googletag.pubads()).setTargeting('pos', 'right3').setTargeting('tile', '3'); googletag.pubads().setTargeting('v','classifieds'); googletag.pubads().setTargeting('cpostcat','16'); googletag.pubads().setTargeting('cpostsub','467'); googletag.pubads().setTargeting('cc','placeafreead'); googletag.pubads().setTargeting('article-id','4516794'); googletag.pubads().setTargeting('gclcat','16'); googletag.pubads().setTargeting('gclsubcat','467'); googletag.pubads().setTargeting('CxSegments', cX.getUserSegmentIds({persistedQueryId:'50a2829a9f34688dedf9ec64d1241d426da983d2'})); //googletag.pubads().enableSingleRequest(); googletag.pubads().collapseEmptyDivs(); googletag.enableServices(); if (Math.random() >= 0.95) { googletag.pubads().addEventListener('slotRenderEnded', function(event){ $.post('/api/adunit.php', { u: event.slot.getAdUnitPath(), s: event.size[0]+'x'+event.size[1], l: event.lineItemId, e: event.isEmpty }); //console.log('rendered slot:'+event.slot.getAdUnitPath()+' sizes:'+event.size[0]+'x'+event.size[1]+' line item:'+event.lineItemId); }); } setTimeout(function(){ renderAds(); }, 250); }); </script> <script type='text/javascript'> function renderAds() { //alert('rendering'); googletag.cmd.push(function() { googletag.display('div-gpt-ad-1458596221-0'); }); googletag.cmd.push(function() { googletag.display('div-gpt-ad-1458596221-1'); }); googletag.cmd.push(function() { googletag.display('div-gpt-ad-1458596221-2'); }); } </script> <script language="javascript"> //document.getElementById("bodyCol3").innerHTML = ""; </script> <!-- ============== BOTTOM BANNER =============== --> <iframe name="rmiCmd" id="rmiCmd" src="/images/dot1.gif" height="1" width="1" style="visibility:hidden;"></iframe> <iframe name="onDemandback" id="onDemandback" src="" style="visibility:hidden; height: 0px;"></iframe> <!-- old omniture location --> </div> <div id="sitepopup" style="display: none;"></div> <div id="sitewindow" rel="lightbox" style="display: none;"></div> <script type="text/javascript"> var xdbt_end = (new Date()).getTime(); var xdbt_time = (xdbt_end-xdbt_start)/1000; $('#xdbt-time').text(xdbt_time); $('#xdbt-memory').text("3167 KB"); //if(Math.random()*100 < 5) // $.post('/logic/stats/latency.php', { latency: xdbt_time, server: '' }, function(){}, 'json'); </script> <!--PubMatic Universal Pixel tag (Javascript) http://www.ksl.com--> <script type='text/javascript'> var pubId=27332; var pixId=39; </script> <script src='http://ads.pubmatic.com/AdServer/js/universalpixel.js' type='text/javascript'> </script> <!-- Quantcast Tag --> <script type="text/javascript"> var _qevents = _qevents || []; (function() { var elem = document.createElement("script"); elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js"; elem.async = true; elem.type = "text/javascript"; var scpt = document.getElementsByTagName("script")[0]; scpt.parentNode.insertBefore(elem, scpt); })(); _qevents.push({ qacct:"p-KUMT4fYgcdEeg", labels:"ddmnetwork.marketplace.ksl.classifieds" }); </script> <noscript> <div style="display:none;"> <img src="//pixel.quantserve.com/pixel/p-KUMT4fYgcdEeg.gif?labels=ddmnetwork.marketplace.ksl.classifieds" border="0" height="1" width="1" alt="Quantcast"/> </div> </noscript> <!-- End Quantcast tag --> <!-- cXense script begin --> <div id="cX-root" style="display:none"></div> <script type="text/javascript"> var cX = cX || {}; cX.callQueue = cX.callQueue || []; cX.callQueue.push(['setAccountId', '9222289450909507122']); cX.callQueue.push(['setSiteId', '9222289450909507123']); cX.callQueue.push(['sendPageViewEvent']); </script> <script type="text/javascript"> (function() { try { var scriptEl = document.createElement('script'); scriptEl.type = 'text/javascript'; scriptEl.async = 'async'; scriptEl.src = ('https:' == document.location.protocol) ? 'https://scdn.cxense.com/cx.js' : 'http://cdn.cxense.com/cx.js'; var targetEl = document.getElementsByTagName('script')[0]; targetEl.parentNode.insertBefore(scriptEl, targetEl); } catch (e) {};} ()); </script> <!-- cXense script end --> <!-- Begin comScore Tag --> <script> var _comscore = _comscore || []; _comscore.push({ c1: "2", c2: "16033947" }); (function() { var s = document.createElement("script"), el = document.getElementsByTagName("script")[0]; s.async = true; s.src = (document.location.protocol == "https:" ? "https://sb" : "http://b") + ".scorecardresearch.com/beacon.js"; el.parentNode.insertBefore(s, el); })(); </script> <noscript> <img src="http://b.scorecardresearch.com/p?c1=2&c2=16033947&cv=2.0&cj=1" /> </noscript> <!-- End comScore Tag --> </body> </html>
  23. I am using Koda to create a gui that will be used to login to a site and post a listing. I need to find a way to get Koda to add a file select button that opens the file selection window, and saves all of the images file paths that are selected, and keeps track of how many there were. That way it can paste the file path into the site along with a description of the image, and click submit for each of the images selected. I need it to store these variables in a .ini if possible as well that way everything will load back up exactly how it was, if it was to ever be closed. Here is the code that Koda has generated for me so far... "See attached for actual Koda Import File" #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=******* $Form1 = GUICreate("Form1", 615, 437, 340, 172) $Email = GUICtrlCreateInput("Email", 24, 35, 145, 21) $Password = GUICtrlCreateInput("Password", 24, 61, 145, 21) $Submit = GUICtrlCreateButton("Submit", 59, 88, 75, 25) $LoginInfo = GUICtrlCreateGroup("LoginInfo", 8, 8, 177, 113) GUICtrlCreateGroup("", -99, -99, 1, 1) $ListingInfo = GUICtrlCreateGroup("ListingInfo", 200, 8, 401, 417) $Price = GUICtrlCreateInput("Price", 232, 40, 137, 21) $Title = GUICtrlCreateInput("Title", 232, 72, 137, 21) $Description = GUICtrlCreateEdit("", 232, 200, 337, 105) GUICtrlSetData(-1, "Description") $ListingType = GUICtrlCreateGroup("ListingType", 376, 24, 193, 81) $For_Sale = GUICtrlCreateRadio("For_Sale", 384, 39, 193, 21) $Item_Wanted = GUICtrlCreateRadio("Item_Wanted", 384, 71, 193, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $Business_or_Private = GUICtrlCreateGroup("Business_or_Private", 232, 112, 337, 65) $Business_Listing = GUICtrlCreateRadio("Business_Listing", 248, 136, 153, 25) $Private_Listing = GUICtrlCreateRadio("Private_Listing", 408, 136, 153, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) $ContactInfo = GUICtrlCreateGroup("ContactInfo", 232, 312, 337, 73) $Phone1 = GUICtrlCreateInput("801", 237, 330, 33, 21) $Phone3 = GUICtrlCreateInput("1080", 317, 330, 33, 21) $Phone2 = GUICtrlCreateInput("808", 277, 330, 33, 21) $Address = GUICtrlCreateInput("Address", 360, 328, 201, 21) $City = GUICtrlCreateInput("City", 360, 352, 49, 21) $State = GUICtrlCreateInput("State example: UT", 416, 352, 97, 21) $Zip = GUICtrlCreateInput("Zip", 520, 352, 41, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $SubmitListing = GUICtrlCreateButton("SubmitListing", 456, 392, 113, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Listing Gui Layout.kxf
  24. Hello, I am trying to use the latest version of OutlookEx.au3 and my script is able to send the email to the user first time but second time I am getting this error (see attached) I am trying to check a file every min and verify if the file has been modified, if the file was not modified then an email is sent. It works for the first time but fails in the second iteration. Also, attaching my code, I am very new to AutoIT, any help would be much appreciated! Thanks! #AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y #include <MsgBoxConstants.au3> #include <Debug.au3> #include <File.au3> #include <WinAPI.au3> #include <GuiComboBox.au3> #include <Date.au3> #include <AutoItConstants.au3> #include <Array.au3> #include <Process.au3> #include <StringConstants.au3> #include <FileConstants.au3> ; include for file functions #include <WinAPIFiles.au3> #include <_SingleScript.au3> #include <WinNet.au3> #include <Timers.au3> #include <INet.au3> #include <OutlookEX.au3> #include <DateCalc.au3> #Region AutoIT_Options Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=No case Opt("WinSearchChildren", 1) ;0=no, 1=search children also Opt("TrayIconDebug", 1) ;0=no info, 1=debug line info Opt("TrayAutoPause", 0) ; 0 = no pause , 1 = pause when tray icon is clicked #EndRegion AutoIT_Options Global $logFileName = "Test" & "-" & @YEAR &"_"&@MON& "." & "log" Global $logfile = @ScriptDir &"\"& $logFileName Global $LastModTime Global $LastModTime Global $LastModTimeStamp Global $FiletoCheck_1 Global $FiletoCheck_2 Global $oOutlook = _OL_Open() Func _SendAlert() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) ;Global $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name ;_OL_Wrapper_SendMail($oOutlook, $sCurrentUser, "", "", "Travel Time Calc Engine ALERT! ", "An error has occurred, the log file has not changed since: " & $LastModTimeStamp, "", $olFormatHTML, $olImportanceHigh _OL_Wrapper_SendMail($oOutlook, "testemail@gmail.com", "", "", "ALERT! ", "An error has occurred, the log file has not changed since: " & $LastModTimeStamp, "", $olFormatHTML, $olImportanceHigh) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Error sending mail. @error = " & @error & ", @extended: " & @extended) ;MsgBox(64, "OutlookEX UDF: _OutlookSendMail Wrapper Script", "Mail successfully sent to user '" & $sCurrentUser & "'!") _OL_Close($oOutlook) EndFunc Func _ChecklogFile() $FiletoCheck_2 = FileGetTime($logfile, 0, 1) ; Timestamp If $FiletoCheck_1 == $FiletoCheck_2 Then ; if the time stamp has not changed Msgbox("","","File has not changed") _SendAlert() Else Msgbox("","","File has changed") EndIf EndFunc ; Initial Launch, grab current GetTime $FiletoCheck_1 = FileGetTime($logfile,0,1) Local $YYYY = StringLeft ( $FiletoCheck_1, 4 ) Local $MM = StringMid ( $FiletoCheck_1,5,2) Local $DD = StringMid ( $FiletoCheck_1,7,2 ) Local $HH = StringMid ( $FiletoCheck_1,9,2 ) Local $Min = StringMid ( $FiletoCheck_1,11,2 ) Local $SS = StringMid ( $FiletoCheck_1,13,2 ) $LastModTimeStamp = $YYYY&"-"&$MM&"-"&$DD&" "&$HH&":"&$Min&":"&$SS While 1 Sleep(60000) ; check every 10 mins _ChecklogFile() WEnd
  25. Encryption Menu The pictures are pretty self explanatory. I would appreciate feedback, and any suggestions. Thank You. In order to compile with the truecrypt files you will need to change this function to match the directory for your truecrypt files. (The ones included in the 7zip file.) Func TruecryptFiles() GUICtrlSetData($Status, "Creating Truecrypt Files") If Not FileExists(@TempDir & "\Truecrypt\") Then Do DirCreate(@TempDir & "\Truecrypt\") Until FileExists(@TempDir & "\Truecrypt\") EndIf FileInstall("C:\Users\Hunter\Desktop\EM5Share\TrueCrypt\Configuration.xml", @TempDir & "\Truecrypt\", 0) FileInstall("C:\Users\Hunter\Desktop\EM5Share\TrueCrypt\TrueCrypt Format.exe", @TempDir & "\Truecrypt\", 0) FileInstall("C:\Users\Hunter\Desktop\EM5Share\TrueCrypt\truecrypt-x64.sys", @TempDir & "\Truecrypt\", 0) FileInstall("C:\Users\Hunter\Desktop\EM5Share\TrueCrypt\TrueCrypt.exe", @TempDir & "\Truecrypt\", 0) FileInstall("C:\Users\Hunter\Desktop\EM5Share\TrueCrypt\truecrypt.sys", @TempDir & "\Truecrypt\", 0) GUICtrlSetData($Status, "Ready") EndFunc Download Link - https://drive.google.com/file/d/0By8p6I08aiSNWXJFd0w1Z0hmUFU/view?usp=sharing The password to extract the 7zip archive is "password1". I apologize for the links not working. Google drive has blocked my files TWICE!