-
Posts
333 -
Joined
-
Last visited
Recent Profile Visitors
Allow2010's Achievements
Universalist (7/7)
7
Reputation
-
sorry, i just wanted to share my additions, please just delete the post(s) if you want/can.
-
Here are some small changes: smtpmailer.zip
-
need help parsing some html
Allow2010 replied to Allow2010's topic in AutoIt General Help and Support
no way...my head is starting to spin 🙂 -
need help parsing some html
Allow2010 replied to Allow2010's topic in AutoIt General Help and Support
Thanks to all who worked on this problem. I am still struggling to completely understand with the regexp parts, but it is getting clearer 🙂 -
need help parsing some html
Allow2010 replied to Allow2010's topic in AutoIt General Help and Support
Thanks a lot, it seems to do the job nicely. Do i understand this correct: ($j = 1 ? ($aRes[5 * $i + $j] = "checked") : $aRes[5 * $i + $j]) is it like If $j = 1 Then If $aRes[5 * $i + $j] = "checked" Then $a_staticroutes[$i][$j] = True Else $a_staticroutes[$i][$j] = False EndIf Else $a_staticroutes[$i][$j] = $aRes[5 * $i + $j] EndIf ? -
need help parsing some html
Allow2010 replied to Allow2010's topic in AutoIt General Help and Support
you are right, but i just hated the solution i came up with. -
need help parsing some html
Allow2010 replied to Allow2010's topic in AutoIt General Help and Support
@jos Thanks for giving me the opportunity to give more details. I have a working solution, but it is really ugly and i was reluctant to post it. If it helps as a starting point, here it is: #include <Array.au3> Dim $a_staticroutes[0][5] $examplelines = '<input type="checkbox" id="route0" name="route0" checked></td><td>1.1.1.1</td><td>2.2.2.2</td><td>3.3.3.3</td>' & _ '<input type="checkbox" id="route1" name="route1" ></td><td>4.4.4.4</td><td>5.5.5.5</td><td>6.6.6.6</td>' & _ '<input type="checkbox" id="route2" name="route2" checked></td><td>7.7.7.7</td><td>8.8.8.8</td><td>9.9.9.9</td>' $counter = 0 While 1 ConsoleWrite("---------------" & @crlf) $name = TextBetween($examplelines, 'id="route', '" name="route', 0, 1+1*$counter, 0, 1+1*$counter) If @error then ExitLoop ConsoleWrite("Name: " & $name & @CRLF) $checked = TextBetween($examplelines, 'name="route' & $name & '" ', '></td><td>', 0, 1, 0, 1+1*$counter) If $checked = "checked" Then $checked = True Else $checked = False EndIf ConsoleWrite("Checked: " & $checked & @CRLF) $ip = TextBetween($examplelines, '></td><td>', '</td><td>', 0, 1+1*$counter, 0, 2+$counter*3) If @error then ExitLoop ConsoleWrite("IP: " & $ip & @CRLF) $mask = TextBetween($examplelines, '</td><td>', '</td><td>', 0, 2+3*$counter, 0, 2+3*$counter+1) If @error then ExitLoop ConsoleWrite("Mask: " & $mask & @CRLF) $gateway = TextBetween($examplelines, '</td><td>', '</td><input ', 0, 3+3*$counter, 0, 1+1*$counter) If @error then ExitLoop ConsoleWrite("GW: " & $gateway & @CRLF) Local $aFill[1][5] = [[$name,$checked,$ip,$mask,$gateway]] _ArrayAdd($a_staticroutes,$aFill) $counter=$counter+1 WEnd _ArrayDisplay($a_staticroutes) Func TextBetween($text, $starttag, $endtag, $casesensebegin = 0, $occurencebegin = 1, $casesenseend = 0, $occurenceend = -1) If StringInStr($text, $starttag, $casesensebegin, $occurencebegin) And StringInStr($text, $endtag, $casesenseend, $occurenceend) Then $begin = StringInStr($text, $starttag, $casesensebegin, $occurencebegin) $begin = $begin + StringLen($starttag) $end = StringInStr($text, $endtag, $casesenseend, $occurenceend) If $end > $begin Then $text = StringMid($text, $begin, $end - $begin) Return $text Else SetError(1) ;begin not > end Return "" EndIf Else SetError(2) ;tags not found Return "" EndIf EndFunc ;==>TextBetween Edit: I should mention, that in some cases i will have to process hundreds of lines and performance might also be a problem with this code -
Hello, i have a router staus page (static routes) which looks like this (there may be hundreds in some cases): <input type="checkbox" id="route0" name="route0" checked></td><td>7.7.9.9</td><td>255.255.255.255</td><td>192.168.0.0</td> <input type="checkbox" id="route0" name="route0" ></td><td>7.7.9.9</td><td>255.255.255.255</td><td>192.168.0.0</td> I would like to generate an array with the following content stateofcheckbox name IP subnet gateway for X lines like in the example above. The array needs to store this info: stateofcheckbox true name route0 IP 7.7.9.9 subnet 255.255.255.255 gateway 192.168.0.0 and for line 2 stateofcheckbox false name route0 IP 7.7.9.9 subnet 255.255.255.255 gateway 192.168.0.0 and so on. Can anyone help me with parsing the html and also with constructing the array? All ideas welcome 🙂 Thanks!
-
Hi, i made some additions to the UDF. They may not be perfect, but they seem to work ok for me. So i decided to upload my version here, just in case someone might need this: SmtpMailerExample.au3 SmtpMailer.au3
-
How to do this for X attachments?
Allow2010 replied to Allow2010's topic in AutoIt General Help and Support
Ah, forget it, it does work...i just misinterpreted the syntax, i thought i had to create the varibale name to call it... -
How to do this for X attachments?
Allow2010 replied to Allow2010's topic in AutoIt General Help and Support
yes, but i can not just use $oEmail.Attachments($i).Fields.Item("urn:schemas:mailheader:content-disposition") = "attachment" as this is some kind of variable name 🙂 At least i think so .-) -
Hello, i need to do something like this: $oEmail.Attachments(1).Fields.Item("urn:schemas:mailheader:content-disposition") = "attachment" $oEmail.Attachments(1).Fields.Item("urn:schemas:mailheader:content-transfer-encoding") = "base64" $oEmail.Attachments(1).Fields.Update $oEmail.Attachments(2).Fields.Item("urn:schemas:mailheader:content-disposition") = "attachment" $oEmail.Attachments(2).Fields.Item("urn:schemas:mailheader:content-transfer-encoding") = "base64" $oEmail.Attachments(2).Fields.Update As i do not know how many attachments are needed, i will have to do it for every added attachment. $oEmail.Attachments(X).Fields.Item("urn:schemas:mailheader:content-disposition") = "attachment" Is there a way to do this? Thanks for your ideas and hints 🙂
-
Can I hide a trayitem like i hide a button?
Allow2010 replied to Allow2010's topic in AutoIt General Help and Support
I want to hide one TrayItem, not the complete trayIcon Compared to a normal GUI: I want to hide one button, not the complete GUI :-) When my Tray Menu has the following options Option1 Option2 Option3 Exit I would like to be able to hide some of the options like i can hide a button on a gui -
Can I hide a trayitem like i hide a button?
Allow2010 replied to Allow2010's topic in AutoIt General Help and Support
So i assume this is a NO :-)