1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. AspirinJunkie

Beiträge von AspirinJunkie

  • Dateigröße wird nicht erkannt/aktualisiert

    • AspirinJunkie
    • 11. Juni 2015 um 17:10

    FileWrite schreibt nicht direkt auf die Festplatte, sondern in einen Puffer.
    Dieser wird erst dann in einen Rutsch auf die Platte geschrieben wenn das Dateihandle geschlossen wird oder der Puffer voll ist.
    Filegetsize lügt also gar nicht wenn es sagt die Datei ist 0 Bytes groß, denn zu diesem Zeitpunkt befinden sich die Daten noch im Puffer.

    Zur Lösung: Eine Möglichkeit ist es nach jedem Schreibvorgang ein FileFlush() zu setzen. Das erzwingt das Leeren des Puffers auf die Festplatte.
    Das ist aber nicht wirklich effektiv.
    Stattdessen ist es sinnvoller die Größe der bereits verarbeiteten Daten zu merken und dann auf diese zuzugreifen:

    Spoiler anzeigen
    AutoIt
    #include <Crypt.au3>
    
    
    Global $iOutFileSize = 0 ; Globale Variable welche _Crypt_EncryptFile2 beschreibt und _Ausgabe liest
    
    
    
    
    HotKeySet("{ESC}","_Ende")
    
    
    AdlibRegister("_Ausgabe",1000)
    
    
    _Crypt_EncryptFile2("C:\test.txt","C:\test.crypt","test",26128)
    
    
    Func _Ende()
    	Exit
    EndFunc
    
    
    Func _Ausgabe()
    	ConsoleWrite("Die Datei ist "&$iOutFileSize&" Bytes groß."&@CRLF)
    EndFunc
    
    
    
    
    
    
    
    
    Func _Crypt_EncryptFile2($sSourceFile, $sDestinationFile, $vCryptKey, $iALG_ID)
    	Local $bTempData = 0, _
    			$hInFile = 0, $hOutFile = 0, _
    			$iError = 0, $iExtended = 0, $iFileSize = FileGetSize($sSourceFile), $iRead = 0, _
    			$bReturn = True
    
    
    	_Crypt_Startup()
    
    
    	Do
    		If $iALG_ID <> $CALG_USERKEY Then
    			$vCryptKey = _Crypt_DeriveKey($vCryptKey, $iALG_ID)
    			If @error Then
    				$iError = @error
    				$iExtended = @extended
    				$bReturn = False
    				ExitLoop
    			EndIf
    		EndIf
    
    
    		$hInFile = FileOpen($sSourceFile, $FO_BINARY)
    		If @error Then
    			$iError = 2
    			$bReturn = False
    			ExitLoop
    		EndIf
    		$hOutFile = FileOpen($sDestinationFile, $FO_OVERWRITE + $FO_CREATEPATH + $FO_BINARY)
    		If @error Then
    			$iError = 3
    			$bReturn = False
    			ExitLoop
    		EndIf
    
    
    		Do
    			$bTempData = FileRead($hInFile, 1024 * 1024)
    			$iRead += BinaryLen($bTempData)
    			$iOutFileSize = $iRead
    			If $iRead = $iFileSize Then
    				$bTempData = _Crypt_EncryptData($bTempData, $vCryptKey, $CALG_USERKEY, True)
    				If @error Then
    					$iError = @error + 400
    					$iExtended = @extended
    					$bReturn = False
    				EndIf
    				FileWrite($hOutFile, $bTempData)
    				ExitLoop 2
    			Else
    				$bTempData = _Crypt_EncryptData($bTempData, $vCryptKey, $CALG_USERKEY, False)
    				If @error Then
    					$iError = @error + 500
    					$iExtended = @extended
    					$bReturn = False
    					ExitLoop 2
    				EndIf
    				FileWrite($hOutFile, $bTempData)
    			EndIf
    ;~ 			FileFlush($hOutFile)
    		Until False
    	Until True
    
    
    	If $iALG_ID <> $CALG_USERKEY Then _Crypt_DestroyKey($vCryptKey)
    	_Crypt_Shutdown()
    	If $hInFile <> -1 Then FileClose($hInFile)
    	If $hOutFile <> -1 Then FileClose($hOutFile)
    
    
    	Return SetError($iError, $iExtended, $bReturn)
    EndFunc   ;==>_Crypt_EncryptFile
    Alles anzeigen
  • Dateigröße wird nicht erkannt/aktualisiert

    • AspirinJunkie
    • 10. Juni 2015 um 17:13

    Weißt du was ein Minimalbeispiel ist?
    Das ist ein Skript welches so klein wie möglich ist und von allem unnötigen befreit wurde aber das angesprochene Verhalten reproduziert.
    Es sollte ohne weitere nötige Anpassungen direkt bei jedem lauffähig sein.

    Das hat den Riesenvorteil, dass dir schneller und besser geholfen werden kann und oftmals du beim Erstellen eines solchen Beispiels selbst auf die Lösung stößt.
    Wenn du ein solches Beispiel hierzu postest wirst du sicherlich schnell Hinweise bekommen.

  • Schleife stoppen

    • AspirinJunkie
    • 9. Juni 2015 um 13:15

    Lesen: AutoIt-Hilfe "GUI-Event-Mode"

  • Brauche Hilfe zu StringRegExp (Neu)

    • AspirinJunkie
    • 8. Juni 2015 um 20:57

    @Bernd
    Gibts da irgendein Tool welches die Anzahl der Schritte ausgibt?

  • Backreferenz bei StringRegExpReplace nur eingeschränkt möglich

    • AspirinJunkie
    • 8. Juni 2015 um 12:34

    Nur eine Vermutung:
    Die StringRegExpReplace ist intern (eventuell) nur ein StringRegExp mit manueller Ersetzung der Matches.
    Die Backreference-Syntax ist dabei nur an die RegEx-Syntax angelehnt.

  • Schnelleres ArrayUnique

    • AspirinJunkie
    • 7. Juni 2015 um 20:34

    Wie hast du es denn getestet, dass es schneller ist als _ArrayUnique?
    Bei meinen Tests war es nämlich deutlich langsamer, was ich aufgrund der Sortierung auch nicht sehr verwunderlich finde.

    Wenn du eine Funktion für 1D-Arrays suchst welche auf jeden Fall schneller arbeitet dann versuch es doch mal so:

    AutoIt
    Func _ArrayUnique2(Const ByRef $aA)
        Local $oD = ObjCreate('Scripting.Dictionary')
        For $i In $aA
            $oD($i) = 0
        Next
        Return $oD.Keys()
    EndFunc
  • Brauche Hilfe zu StringRegExp (Neu)

    • AspirinJunkie
    • 7. Juni 2015 um 13:37

    du hast ja auch mehr im Pattern verändert als ich gesagt habe.
    Folgendes Pattern richtet es:'id=".*?(\d+)".+src="text/bild1.+"'

    Und folgendes sollte stabiler sein:

    Code
    (?s)id="[^"]*?(\d+)"(?:.(?!<div))+src="text/bild1[^"]+"
  • Brauche Hilfe zu StringRegExp (Neu)

    • AspirinJunkie
    • 7. Juni 2015 um 12:55

    hinter das erste .* noch ein ?

  • Frage zu vergleichende Operatoren

    • AspirinJunkie
    • 6. Juni 2015 um 13:01

    Kommt auch bisschen auf den Anwendungsfall an.
    Wenn du nichts macht, ist die Vorbelegung wie gesagt ein Nullstring.
    wenn du dann damit rechnest wird dieser implizit als numerisch 0 betrachtet - also genau das was du eigentlich wolltest.

  • Frage zu vergleichende Operatoren

    • AspirinJunkie
    • 5. Juni 2015 um 08:04

    crap_inhuman hat diesen Fall ja schon implizit mit dem ==-Operator umgesetzt. Damit spart man sich das explizite String().
    Mal abgesehen, davon dass Binary('') damit auch als Leerstring erkannt wird obwohl es keiner ist.
    In AutoIt sind, wie gesagt, Variablen, wenn sie deklariert aber nicht definiert werden, implizit ein Leerstring.
    Um das abzufragen muss man also auch den Variablentyp mit reinnehmen: If IsString($Var) And ($Var = "") Then 

  • Brauche Hilfe zu WinHTTP

    • AspirinJunkie
    • 4. Juni 2015 um 21:19

    Doch Browser-Automatisierung.
    Es gibt UDFs für IE und Firefox.

  • Brauche Hilfe zu WinHTTP

    • AspirinJunkie
    • 4. Juni 2015 um 21:09

    Weil diese erst über Javascript erzeugt werden.
    Hier bei Dropbox kann man davon ausgehen das ausgiebig auf AJAX gesetzt wird - dabei werden dynamisch Inhalte während der "Anzeige" der Seite über Javascript geladen.
    Da WinHTTP kein Javascript ausführt hast du auch keinen Zugriff auf die dynamisch erzeugten Elemente.

  • Brauche Hilfe zu WinHTTP

    • AspirinJunkie
    • 4. Juni 2015 um 20:29

    Welche Seite?
    Sonst können wir nur raten.

  • Frage zu vergleichende Operatoren

    • AspirinJunkie
    • 4. Juni 2015 um 12:10

    Was möchtest du mit IsNumber klären?
    crap_inhuman möchte herausfinden ob eine Variable leer ist - wenn sie also nur deklariert aber nicht definiert wurde.
    Neue Variablen werden in AutoIt implizit als Leerstring definiert.
    Wenn du nun IsNumber() zur Klärung dieser Frage einsetzen willst dann verstehe ich nicht wie das damit funktionieren soll.
    IsNumber liefert ja nur True zurück bei Double/Int32/Int64-Variablen.
    Darauf Rückschlüsse auf einen String zu ziehen geht nicht da AutoIt ja weiterhin noch die Typen Reference(Pointer)/HWND/Bool/Binary und Array kennt.
    Wenn eine, von ihm zu prüfende Variable einen entsprechenden Typ besitzt, wird sie ihm fälschlicherweise als "leer" angezeigt.

  • RegEx?

    • AspirinJunkie
    • 4. Juni 2015 um 10:29

    Siehe mein vorheriges Beispiel ohne RegEx:

    Spoiler anzeigen
    AutoIt
    #include <array.au3>
    
    
    Local $sString = '<tr class="nowrap row_a">' & @CRLF & _
    		'		<td><a href="index.php?id=5277&amp;screen=view">Art1(12-31)</a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5280&screen=object"><img src="a.png" title="a" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5280&screen=object"><img src="b.png" title="b" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5280&screen=object"><img src="c.png" title="c" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5280&screen=object"><img src="d.png" title="d" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5280&screen=object"><img src="e.png" title="e" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="bestand.php?id=5280&screen=best">1/23</a></td>' & @CRLF & _
    		'		<td>8364</td>' & @CRLF & _
    		'		<td class="hidden">0</td>' & @CRLF & _
    		'		<td>723</td>' & @CRLF & _
    		'		<td>45</td>' & @CRLF & _
    		'		<td class="hidden">0</td>' & @CRLF & _
    		'		<td>3</td>' & @CRLF & _
    		'		<td>1256</td>' & @CRLF & _
    		'		<td class="hidden">0</td>' & @CRLF & _
    		'		<td><a href="view.php&id=5280&screen=buy">200/200</a></td>' & @CRLF & _
    		'	</tr>' & @CRLF & _
    		'	<tr class="nowrap row_b">' & @CRLF & _
    		'		<td><a href="index.php?id=5278&amp;screen=view">Art2 (40-483)</a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5278&screen=object"><img src="a.png" title="a" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5278&screen=object"><img src="b.png" title="b" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5278&screen=object"><img src="c.png" title="c" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5278&screen=object"><img src="d.png" title="d" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5278&screen=object"><img src="e.png" title="e" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="bestand.php?id=5280&screen=best">999/1000</a></td>' & @CRLF & _
    		'		<td>1234</td>' & @CRLF & _
    		'		<td>3762</td>' & @CRLF & _
    		'		<td>723</td>' & @CRLF & _
    		'		<td class="hidden">0</td>' & @CRLF & _
    		'		<td class="hidden">0</td>' & @CRLF & _
    		'		<td>3</td>' & @CRLF & _
    		'		<td class="hidden">0</td>' & @CRLF & _
    		'		<td>12</td>' & @CRLF & _
    		'		<td><a href="view.php&id=5278&screen=buy">200/200</a></td>' & @CRLF & _
    		'	</tr>' & @CRLF & _
    		'	<tr class="nowrap row_a">' & @CRLF & _
    		'		<td><a href="index.php?id=5280&amp;screen=view">Art3 (399-486)</a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5280&screen=object"><img src="a.png" title="a" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5280&screen=object"><img src="b.png" title="b" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5280&screen=object"><img src="c.png" title="c" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5280&screen=object"><img src="d.png" title="d" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="view.php?id=5280&screen=object"><img src="e.png" title="e" alt="" /></a></td>' & @CRLF & _
    		'		<td><a href="bestand.php?id=5280&screen=best">5/26</a></td>' & @CRLF & _
    		'		<td class="hidden">0</td>' & @CRLF & _
    		'		<td>2348</td>' & @CRLF & _
    		'		<td>723</td>' & @CRLF & _
    		'		<td>1</td>' & @CRLF & _
    		'		<td class="hidden">0</td>' & @CRLF & _
    		'		<td>3</td>' & @CRLF & _
    		'		<td class="hidden">0</td>' & @CRLF & _
    		'		<td>12</td>' & @CRLF & _
    		'		<td><a href="view.php&id=5280&screen=buy">200/200</a></td>' & @CRLF & _
    		'	</tr>' & @CRLF
    
    
    
    
    ;~ ; alle trs durchgehen:
    $a_TRs = _CssSelectFromString($sString, "tr.nowrap")
    For $i = 0 To UBound($a_TRs) - 1
    	; alle tds im jeweilgen tr ermitteln:
    	$a_TDs = _CssSelectFromString($a_TRs[$i][2], "td")
    
    
    	; in <a> verpackte Elemente noch auflösenist noch in <a>-Element verschachtelt - dieses noch auflösen:
    	For $j = 0 To UBound($a_TDs) - 1
    		If StringLeft($a_TDs[$j][2], 3) = "<a " Then $a_TDs[$j][2] = _CssSelectFromString($a_TDs[$j][2], "a")[0][2]
    	Next
    	_ArrayDisplay($a_TDs)
    Next
    
    
    
    
    
    
    ; #FUNCTION# ======================================================================================
    ; Name ..........: _CssSelectFromString()
    ; Description ...: extract elements out of a html string with css-style selectors
    ; Syntax ........: _CssSelectFromString($s_String, $s_Selector, {Const $b_First = True})
    ; Parameters ....: $s_String      - the html string
    ;                  $s_Selector    - the css-style selector
    ;                  {$b_First}     - dont't touch! - for internal use only!
    ; Return values .: Success: Array[...][0] = element attributes string
    ;                           Array[...][1] = element content string
    ;                  Failure: ""
    ;                     @error = 1: no balanced elements found
    ; Remarks .......: The following CSS-Selector-Features are implemented:
    ;                  .class               - class of a element
    ;                  #ID                  - ID of a element
    ;                  [attribute]          - attribute exist
    ;                  [attribute="value"]  - elements with attribute=value
    ;                  [attribute^="value"] - elements where attribute starting with value
    ;                  [attribute~="value"] - elements where attribute containing value
    ;                  [attribute$="value"] - elements where attribute ending with value
    ;                  :first               - only the first element gets returned
    ;                  :nth-of-type(<number>) - match only the nth match of the element
    ;                  :has(<Selector>)     - elements which contain at least one element that matches the specified selector
    ;                  :nothas(<Selector>)  - elements which not contain a element that matches the specified selector
    ; Known bugs ....: - If Balancing is not correct in the string - the result is also not correct
    ;                  - If selector is too general - some result may get doubled - to solve this: be as exactly as possible
    ; Author ........: AspirinJunkie
    ; Version .......: 0.8.1
    ; =================================================================================================
    Func _CssSelectFromString($s_String, $s_Selector, Const $b_First = True, Const $b_SubCheck = False)
    	Local $s_Type = ""
    	Local $a_RegEx, $ID, $i, $j, $a_Ret, $s_Attrs
    	Local Static $o_Result
    	Local $d_RetCounter = 0
    
    
    	If $b_First Then
    		$s_String = StringRegExpReplace($s_String, "(?s)(?x)(?:<!--.+?)(?R)?(?:-->)", "") ; Kommentare killen
    		$s_String = StringRegExpReplace($s_String, "(?s)(?x)(?:<script.+?)(?R)?(?:</script)", "") ; Script-Elemente killen (Inhalt könnte Probleme beim Parsen bringen)
    		$s_String = StringRegExpReplace($s_String, "(?s)^.+<body\b(.+?)</body>.+$", "$1") ; Nur Inhalt des Bodys verwenden
    		$o_Result = ObjCreate('Scripting.Dictionary')
    	EndIf
    
    
    	$s_Selector = StringStripWS($s_Selector, 7)
    	Local $s_CurrentSelector = StringRegExp($s_Selector, '^((?:"\s*[^"]+\s*[^"]+"|\(((?:.|(?R))*)\)|\S)+)', 1)[0]
    	Local $s_SelectorRest = StringStripWS(StringTrimLeft($s_Selector, @extended), 1)
    
    
    	; Get the element type:
    	$a_RegEx = StringRegExp($s_CurrentSelector, "^(\w*)", 1)
    	If @error Then Return SetError(1, @error, "")
    	$s_Type = $a_RegEx[0]
    
    
    	; Alle Typen durchgehen und auf Übereinstimmung mit weiteren KLassifikatoren prüfen
    	Local $a_Types = _HtmlElements($s_String, $s_Type, True)
    
    
    	Local $a_HasProperty = StringRegExp($s_CurrentSelector, ":has\(\s*((?:.|(?R))*)\)", 3)
    	If @error Then Local $a_HasProperty[0]
    	Local $a_nothasProperty = StringRegExp($s_CurrentSelector, ":nothas\(\s*((?:.|(?R))*)\)", 3)
    	If @error Then Local $a_nothasProperty[0]
    	$s_CurrentSelector = StringRegExpReplace($s_CurrentSelector, ":(has|nothas)\(\s*((?:.|(?R))*)\)", "") ; delete :has and :nothas-Selectors because the inner Selector shouldn't processed by the following Selectors
    	Local $a_AttribOpt = StringRegExp($s_CurrentSelector, "\[(\w+)\s*([~\*|\^\$]?=)\s*['""](.+?)['""]\s*\]", 4)
    	If @error Then Local $a_AttribOpt[0]
    	Local $a_ClassesOpt = StringRegExp($s_CurrentSelector, "\.(\w+)", 3)
    	If @error Then Local $a_ClassesOpt[0]
    	Local $a_IDOpt = StringRegExp($s_CurrentSelector, "#(\w+)", 3)
    	If @error Then Local $a_IDOpt[0]
    	Local $b_EmptyProperty = StringRegExp($s_CurrentSelector, ":empty\b", 0)
    	$a_RegEx = StringRegExp($s_CurrentSelector, ":nth-of-type\((\d+)\)", 1)
    	Local $d_NthOfType = @error ? 0 : $a_RegEx[0]
    
    
    	For $j = 0 To UBound($a_Types) - 1
    		$s_Attrs = $a_Types[$j][1]
    		; Check for ID:
    		For $ID In $a_IDOpt
    			If Not StringRegExp($s_Attrs, "(?x)\bid=['""]\b" & $ID & "\b['""]") Then ContinueLoop 2
    		Next
    		; Check for class:
    		For $Class In $a_ClassesOpt
    			If Not StringRegExp($s_Attrs, "(?x)\bclass=['""][^'"">]*?\b" & $Class & "\b[^'"">]*?['""](?x)") Then ContinueLoop 2
    		Next
    		; Check for attributes:
    		; check for exist:
    		$a_RegEx = StringRegExp($s_CurrentSelector, "\[(\w+)\s*\]", 3)
    		If Not @error Then
    			For $Attr In $a_RegEx
    				If Not StringRegExp($s_Attrs, "(?x)\b" & $Attr & "\b[=\s$]") Then ContinueLoop 2
    			Next
    		EndIf
    		For $AttrVal In $a_AttribOpt
    			Switch $AttrVal[2]
    				Case "=" ; full match
    					If Not StringRegExp($s_Attrs, "(?x)" & $AttrVal[1] & "=['""]" & $AttrVal[3] & "['""]") Then ContinueLoop 2
    				Case "~=", "*=" ; partial match
    					If Not StringRegExp($s_Attrs, "(?x)" & $AttrVal[1] & "=['""][^'""]*" & $AttrVal[3] & "[^'""]*['""]") Then ContinueLoop 2
    				Case "|=", "^=" ; start match
    					If Not StringRegExp($s_Attrs, "(?x)" & $AttrVal[1] & "=['""]" & $AttrVal[3] & "[^'""]*['""]") Then ContinueLoop 2
    				Case "$=" ; end match
    					If Not StringRegExp($s_Attrs, "(?x)" & $AttrVal[1] & "=['""][^'""]*" & $AttrVal[3] & "['""]") Then ContinueLoop 2
    			EndSwitch
    		Next
    
    
    		;has(<Selector>)
    		For $HasSelector In $a_HasProperty
    			If Not _CssSelectFromString(StringMid($s_String, $a_Types[$j][4], $a_Types[$j][5] - $a_Types[$j][4]), $HasSelector, False, True) Then ContinueLoop 2
    		Next
    		;nothas(<Selector>)
    		For $NotSelector In $a_nothasProperty
    			If _CssSelectFromString(StringMid($s_String, $a_Types[$j][4], $a_Types[$j][5] - $a_Types[$j][4]), $NotSelector, False, True) Then ContinueLoop 2
    		Next
    		;:empty
    		If $b_EmptyProperty Then
    			If Not StringIsSpace(StringMid($s_String, $a_Types[$j][4], $a_Types[$j][5] - $a_Types[$j][4])) Then ContinueLoop
    		EndIf
    		;:nth-of-type()
    		If $d_NthOfType Then
    			$d_RetCounter += 1
    			If $d_RetCounter <> $d_NthOfType Then ContinueLoop
    		EndIf
    
    
    		; save result element
    		If $s_SelectorRest = "" Then
    			If $b_SubCheck Then Return True
    			Local $a_T[3] = [$a_Types[$j][0], $a_Types[$j][1], StringMid($s_String, $a_Types[$j][4], $a_Types[$j][5] - $a_Types[$j][4])]
    			$o_Result($o_Result.Count) = $a_T
    		Else
    			If $b_SubCheck Then
    				Return _CssSelectFromString(StringMid($s_String, $a_Types[$j][4], $a_Types[$j][5] - $a_Types[$j][4]), $s_SelectorRest, False, True)
    			Else
    				_CssSelectFromString(StringMid($s_String, $a_Types[$j][4], $a_Types[$j][5] - $a_Types[$j][4]), $s_SelectorRest, False)
    			EndIf
    		EndIf
    
    
    		; check for ":first" selector
    		If StringInStr($s_CurrentSelector, ":first", 2) Then ExitLoop
    		If $d_NthOfType And $d_RetCounter = $d_NthOfType Then ExitLoop ; :nth-of-type() - break because following elements could'nt match
    	Next
    
    
    	If $b_SubCheck Then Return False ; if recursion is inside a :has or :nothas-Selector
    
    
    	If $b_First Then
    		Local $n = $o_Result.Count
    		Local $a_Return[$n][3]
    		Local $v = 0
    		For $i In $o_Result.Items()
    			$a_Return[$v][0] = StringStripWS($i[0], 3)
    			$a_Return[$v][1] = StringStripWS($i[1], 3)
    			$a_Return[$v][2] = StringStripWS($i[2], 3)
    			$v += 1
    		Next
    		Return $a_Return
    	EndIf
    EndFunc   ;==>_CssSelectFromString
    
    
    
    
    
    
    
    
    ; #FUNCTION# ======================================================================================
    ; Name ..........: _HtmlElements()
    ; Description ...: extract all elements of type $s_Type from a html string
    ; Syntax ........: _HtmlElements(ByRef $s_Html, Const $s_Type)
    ; Parameters ....: $s_Html        - the html string
    ;                  $s_Type        - the html element type which should to extract
    ;                  $bN            - False: returns 4-column array with element content as a string
    ;                                 - True: returns 6-column array with substring positions of
    ;                                         element and it's content inside of $s_Html
    ; Return values .: Success: Array[...][0] = element attributes string
    ;                           Array[...][1] = element content string
    ;                  Failure: ""
    ;                     @error = 1: no balanced elements found
    ; Known bugs ....: If Balancing is not correct in the string - the result is also not correct
    ; Author ........: AspirinJunkie
    ; =================================================================================================
    Func _HtmlElements(ByRef $s_Html, Const $s_Type = "", Const $bN = False)
    	Local $d_Start, $d_End, $d_T, $d_Pos = 1, $x = 0, $a_Element
    	Local $s_Begin = "<" & $s_Type, $s_Ende = "</" & $s_Type
    	Local $nB = StringLen($s_Begin)
    	Local $oVoids = ObjCreate("Scripting.Dictionary") ; replace later with AutoIt-Maps
    
    
    	Local $s_Ends = "", $s_Begins = ""
    	Local $s_VoidEnds = "", $s_VoidBegins = ""
    	Local $dOff, $a_T, $s_ElType, $s_T
    
    
    	Local Const $s_REstart = ($s_Type = "") ? "(<\w+\b)" : "(<" & $s_Type & "\b)"
    	Local Const $s_REend = ($s_Type = "") ? "(</\w+\b)" : "(</" & $s_Type & "\b)"
    
    
    	; Alle Tag-Anfänge ermitteln:
    	Do
    		$a_T = StringRegExp($s_Html, $s_REstart, 1, $d_Pos)
    		$dOff = @extended
    		If $dOff = 0 Then ExitLoop
    		$d_T = $dOff - StringLen($a_T[0])
    
    
    		; void element form (e.g: <link href="fancy.css" type="text/css" /> )
    		$a_T = StringRegExp($s_Html, "\G<(area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)\s*([^<]*?)/?>", 1, $d_T)
    		$dOff = @extended
    		If $dOff Then
    			Local $aTemp[4] = [$a_T[0], $a_T[1], $d_T, $dOff]
    			$d_Pos = $dOff
    			$oVoids($d_T) = $aTemp
    		Else ; normal elements
    			$s_Begins &= $d_T & "|"
    			$d_Pos = $d_T + $nB
    		EndIf
    		$x += 1
    	Until 0
    
    
    	; Alle Tag-Enden ermitteln:
    	$d_Pos = 1
    	Do
    		$a_T = StringRegExp($s_Html, $s_REend, 1, $d_Pos)
    		$dOff = @extended
    		If $dOff = 0 Then ExitLoop
    		$s_Ends &= $dOff - StringLen($a_T[0]) & "|"
    		$d_Pos = $dOff
    	Until 0
    
    
    	If $s_Begins <> "" And $s_Ends <> "" Then
    		Local $a_Starts = StringSplit(StringTrimRight($s_Begins, 1), "|", 2)
    		Local $a_Ends = StringSplit(StringTrimRight($s_Ends, 1), "|", 2)
    		For $i = 0 To UBound($a_Starts) - 1
    			$a_Starts[$i] = Int($a_Starts[$i])
    		Next
    		For $i = 0 To UBound($a_Ends) - 1
    			$a_Ends[$i] = Int($a_Ends[$i])
    		Next
    
    
    		; Funde matchen
    		Local $dMax = UBound($a_Ends) > UBound($a_Starts) ? UBound($a_Starts) : UBound($a_Ends)
    		Local $a_Return[$dMax + $oVoids.Count][($bN ? 6 : 4)]
    		If $dMax > 0 Then
    			Local $d_End
    			For $i = 0 To UBound($a_Ends) - 1
    				$d_End = $a_Ends[$i]
    				For $j = UBound($a_Starts) - 1 To 0 Step -1
    					$d_Start = $a_Starts[$j]
    					If $d_Start = 1000000000 Then ContinueLoop
    					If $d_Start < $d_End Then
    						If $bN Then
    							$a_Element = StringRegExp($s_Html, "(?s)\G<(\w+)\b\s?(.*?)>", 1, $d_Start)
    							$dOff = @extended
    							If UBound($a_Element) < 2 Then ContinueLoop
    							$a_Return[$i][0] = $a_Element[0]
    							$a_Return[$i][1] = $a_Element[1]
    							$a_Return[$i][2] = Int($d_Start)
    							$a_Return[$i][3] = Int($d_End) + 3 + StringLen($a_Element[0])
    							$a_Return[$i][4] = $dOff
    							$a_Return[$i][5] = Int($d_End)
    						Else
    							$a_Element = StringRegExp(StringMid($s_Html, $d_Start, $d_End - $d_Start + StringLen($s_Ende)), "(?s)^<(\w+)\b\s?(.*?)>(.*)</" & $s_Type, 3)
    ;~ 						$a_Element = StringRegExp($s_Html, "(?s)\G<" & $s_Type & "\s?(.*?)>(.*?)</" & $s_Type, 3, $d_Start)
    							If UBound($a_Element) < 2 Then ContinueLoop
    							$a_Return[$i][0] = $a_Element[0]
    							$a_Return[$i][1] = $a_Element[1]
    							$a_Return[$i][2] = $a_Element[2]
    							$a_Return[$i][3] = Int($d_Start)
    						EndIf
    
    
    						$a_Starts[$j] = 1000000000
    						ContinueLoop 2
    					EndIf
    				Next
    			Next
    		EndIf
    	Else
    		Local $a_Return, $dMax = 0
    	EndIf
    
    
    	; add the void elements to the result array
    	If Not IsArray($a_Return) Then Local $a_Return[$oVoids.Count][($bN ? 6 : 4)]
    	Local $c = 0
    	For $i In $oVoids.Items
    		$a_Return[$dMax + $c][0] = $i[0]
    		$a_Return[$dMax + $c][1] = $i[1]
    		If $bN Then
    			$a_Return[$dMax + $c][2] = $i[2]
    			$a_Return[$dMax + $c][3] = $i[3]
    		Else
    			$a_Return[$dMax + $c][3] = $i[2]
    		EndIf
    		$c += 1
    	Next
    
    
    	_ArraySort($a_Return, 0, 0, 0, ($bN ? 2 : 3))
    	Return $a_Return
    EndFunc   ;==>_HtmlElements
    Alles anzeigen
  • RegEx?

    • AspirinJunkie
    • 4. Juni 2015 um 08:51

    Wenn die Anzahl der Spalten fest ist, musst du eigentlich nur noch die beiden Spalten dazwischen auslassen.
    Du hast jedoch .* verwendet. In dem Moment wird er solange im String weitersuchen bis er das letzte <td gefunden hat, denn .* ist gierig - es will soviel wie möglich sammeln.
    Deswegen hilft .*?. Dann sucht er nur bis zum ersten <td.

    Das erweiterte Pattern könnte daher so aussehen:

    Code
    (?s)<td><a href=".+?\?id=(\d+).*?>([^<]+)<.+?<td>(\d+).+?<td.+?<td.+?<td>([^<])+


    Aber: Das wird mit dem Verständnis dann immer komplizierter.
    Und spätestens in einem Jahr, wenn du das wieder anpassen willst, weißt du nicht mehr was hier eigentlich passiert.
    Daher wäre eine intuitivere Methode sicherlich die bessere Wahl als ein solches RegEx-Ungetüm.

    Hier daher mal ein Beispiel wie man an die Daten gelangt in dem man den XML-String schrittweise über CSS-Selektoren zerlegt:

    Spoiler anzeigen
    AutoIt
    #include <array.au3>
    
    
    Local $sString = '<tr class="nowrap row_a">' & @CRLF & _
    '		<td><a href="index.php?id=5277&amp;screen=view">Art1(12-31)</a></td>' & @CRLF & _
    '		<td>499</td>' & @CRLF & _
    '		<td>Beschreibung</td>' & @CRLF & _
    '		<td>Dies ist eine Beschreibung</td>' & @CRLF & _
    '		<td>1/23</td>' & @CRLF & _
    '	</tr>' & @CRLF & _
    '	<tr class="nowrap row_b">' & @CRLF & _
    '		<td><a href="index.php?id=5278&amp;screen=view">Art2 (40-483)</a></td>' & @CRLF & _
    '		<td>899</td>' & @CRLF & _
    '		<td>Beschreibung</td>' & @CRLF & _
    '		<td>Lalala</td>' & @CRLF & _
    '		<td>999/1000</td>' & @CRLF & _
    '	</tr>' & @CRLF & _
    '	<tr class="nowrap row_a">' & @CRLF & _
    '		<td><a href="index.php?id=5280&amp;screen=view">Art3 (399-486)</a></td>' & @CRLF & _
    '		<td>19999</td>' & @CRLF & _
    '		<td>Beschreibung</td>' & @CRLF & _
    '		<td>Bablaldfhusdfwe</td>' & @CRLF & _
    '		<td>5/26</td>' & @CRLF & _
    '	</tr>' & @CRLF
    
    
    
    
    ; alle trs durchgehen:
    $a_TRs = _CssSelectFromString($sString, "tr.nowrap")
    For $i = 0 To UBound($a_TRs) -1
    	; alle tds im jeweilgen tr ermitteln:
    	$a_TDs = _CssSelectFromString($a_TRs[$i][2], "td")
    
    
    	; Artikel ist noch in <a>-Element verschachtelt - dieses noch auflösen:
    	$a_TDs[0][2] = _CssSelectFromString($a_TDs[0][2], "a")[0][2]
    
    
    	_ArrayDisplay($a_TDs)
    Next
    
    
    
    
    ; #FUNCTION# ======================================================================================
    ; Name ..........: _CssSelectFromString()
    ; Description ...: extract elements out of a html string with css-style selectors
    ; Syntax ........: _CssSelectFromString($s_String, $s_Selector, {Const $b_First = True})
    ; Parameters ....: $s_String      - the html string
    ;                  $s_Selector    - the css-style selector
    ;                  {$b_First}     - dont't touch! - for internal use only!
    ; Return values .: Success: Array[...][0] = element attributes string
    ;                           Array[...][1] = element content string
    ;                  Failure: ""
    ;                     @error = 1: no balanced elements found
    ; Remarks .......: The following CSS-Selector-Features are implemented:
    ;                  .class               - class of a element
    ;                  #ID                  - ID of a element
    ;                  [attribute]          - attribute exist
    ;                  [attribute="value"]  - elements with attribute=value
    ;                  [attribute^="value"] - elements where attribute starting with value
    ;                  [attribute~="value"] - elements where attribute containing value
    ;                  [attribute$="value"] - elements where attribute ending with value
    ; Known bugs ....: - no empty element type is allowed - you have to set a type
    ;                  - If Balancing is not correct in the string - the result is also not correct
    ;                  - If selector is too general - some result may get doubled - to solve this: be as exactly as possible
    ; Author ........: AspirinJunkie
    ; Version .......: 0.8
    ; =================================================================================================
    Func _CssSelectFromString($s_String, $s_Selector, Const $b_First = True)
    	Local $s_Type = ""
    	Local $a_RegEx, $b_Match, $ID, $i, $j, $a_Ret
    	Local Static $o_Result
    
    
    	If $b_First Then
    		$s_String = StringRegExpReplace($s_String, "(?s)(?x)(?:<!--.+?)(?R)?(?:-->)", "") ; Kommentare killen
    		$s_String = StringRegExpReplace($s_String, "(?s)(?x)(?:<script.+?)(?R)?(?:</script)", "") ; Script-Elemente killen (Inhalt könnte Probleme beim Parsen bringen)
    		$s_String = StringRegExpReplace($s_String, "(?s)^.+<body\b(.+?)</body>.+$", "$1") ; Nur Inhalt des Bodys verwenden
    		$o_Result = ObjCreate('Scripting.Dictionary')
    	EndIf
    
    
    	$s_Selector = StringStripWS($s_Selector, 7)
    	Local $s_CurrentSelector = StringRegExp($s_Selector, "^(\S+)", 3)[0]
    	Local $s_SelectorRest = StringStripWS(StringRegExpReplace($s_Selector, "^(\S+)", ""), 7)
    
    
    	; Get the element type:
    	$a_RegEx = StringRegExp($s_CurrentSelector, "^(\w*)", 3)
    	If @error Then Return SetError(1, @error, "")
    	$s_Type = $a_RegEx[0]
    
    
    	; Alle Typen durchgehen und auf Übereinstimmung mit weiteren KLassifikatoren prüfen
    	Local $a_Types = _HtmlElements($s_String, $s_Type)
    
    
    	Local $a_AttribOpt = StringRegExp($s_CurrentSelector, "\[(\w+)\s*([~\*|\^\$]?=)\s*['""](.+?)['""]\s*\]", 4)
    	If @error Then Local $a_AttribOpt[0]
    	Local $a_ClassesOpt = StringRegExp($s_CurrentSelector, "\.(\w+)", 3)
    	If @error Then Local $a_ClassesOpt[0]
    	Local $a_IDOpt = StringRegExp($s_CurrentSelector, "#(\w+)", 3)
    	If @error Then Local $a_IDOpt[0]
    
    
    	For $j = 0 To UBound($a_Types) - 1
    		$b_Match = True
    		; Check for ID:
    		For $ID In $a_IDOpt
    			If Not StringRegExp($a_Types[$j][0], "(?x)\bid=['""]\b" & $ID & "\b['""]") Then ContinueLoop 2
    		Next
    
    
    		; Check for class:
    		For $Class In $a_ClassesOpt
    			If Not StringRegExp($a_Types[$j][0], "(?x)\bclass=['""][^'"">]*?\b" & $Class & "\b[^'"">]*?['""](?x)") Then ContinueLoop 2
    		Next
    
    
    		; Check for attributes:
    		; check for exist:
    		$a_RegEx = StringRegExp($s_CurrentSelector, "\[(\w+)\s*\]", 3)
    		If Not @error Then
    			For $Attr In $a_RegEx
    				If Not StringRegExp($a_Types[$j][0], "(?x)\b" & $Attr & "\b[=\s$]") Then ContinueLoop 2
    			Next
    		EndIf
    		For $AttrVal In $a_AttribOpt
    			Switch $AttrVal[2]
    				Case "=" ; full match
    					If Not StringRegExp($a_Types[$j][0], "(?x)" & $AttrVal[1] & "=['""]" & $AttrVal[3] & "['""]") Then ContinueLoop 2
    				Case "~=", "*=" ; partial match
    					If Not StringRegExp($a_Types[$j][0], "(?x)" & $AttrVal[1] & "=['""][^'""]*" & $AttrVal[3] & "[^'""]*['""]") Then ContinueLoop 2
    				Case "|=", "^=" ; start match
    					If Not StringRegExp($a_Types[$j][0], "(?x)" & $AttrVal[1] & "=['""]" & $AttrVal[3] & "[^'""]*['""]") Then ContinueLoop 2
    				Case "$=" ; end match
    					If Not StringRegExp($a_Types[$j][0], "(?x)" & $AttrVal[1] & "=['""][^'""]*" & $AttrVal[3] & "['""]") Then ContinueLoop 2
    			EndSwitch
    		Next
    
    
    		; save result element
    		If $s_SelectorRest = "" Then
    			Local $a_T[3] = [$s_Type, $a_Types[$j][0], $a_Types[$j][1]]
    			$o_Result($o_Result.Count) = $a_T
    		Else
    			_CssSelectFromString($a_Types[$j][1], $s_SelectorRest, False)
    		EndIf
    
    
    		; check for ":first" selector
    		If StringInStr($s_CurrentSelector, ":first", 2) Then ExitLoop
    ;~ 		If StringInStr($s_CurrentSelector, ":nth-of-type(" & $d_RetCounter & ")", 2) Then
    	Next
    
    
    	If $b_First Then
    		Local $n = $o_Result.Count
    		Local $a_Return[$n][3]
    		Local $v = 0
    		For $i In $o_Result.Keys()
    			$a_Return[$v][0] = StringStripWS($o_Result($i)[0], 3)
    			$a_Return[$v][1] = StringStripWS($o_Result($i)[1], 3)
    			$a_Return[$v][2] = StringStripWS($o_Result($i)[2], 3)
    			$v += 1
    		Next
    		Return $a_Return
    	EndIf
    EndFunc   ;==>_CssSelectFromString
    
    
    
    
    
    
    
    
    ; #FUNCTION# ======================================================================================
    ; Name ..........: _HtmlElements()
    ; Description ...: extract all elements of type $s_Type from a html string
    ; Syntax ........: _HtmlElements(ByRef $s_Html, Const $s_Type)
    ; Parameters ....: $s_Html        - the html string
    ;                  $s_Type        - the html element type which should to extract
    ; Return values .: Success: Array[...][0] = element attributes string
    ;                           Array[...][1] = element content string
    ;                  Failure: ""
    ;                     @error = 1: no balanced elements found
    ; Known bugs ....: If Balancing is not correct in the string - the result is also not correct
    ; Author ........: AspirinJunkie
    ; =================================================================================================
    Func _HtmlElements(ByRef $s_Html, Const $s_Type)
    	Local $d_Start, $d_End, $d_T, $d_Pos = 1, $x = 0, $a_Element
    	Local $s_Begin = "<" & $s_Type, $s_Ende = "</" & $s_Type
    
    
    	Local $n = UBound(StringRegExp($s_Html, $s_Begin, 3))
    	Local $u = UBound(StringRegExp($s_Html, $s_Ende, 3))
    
    
    	If $n = 0 Or $u = 0 Then Return SetError(1, 0, "")
    	Local $a_Starts[$n], $a_Ends[$u]
    
    
    	; Alle Tag-Anfänge ermitteln:
    	Do
    		$d_T = StringInStr($s_Html, $s_Begin, 2, 1, $d_Pos)
    		If $d_T = 0 Then ExitLoop
    
    
    		$a_Starts[$x] = $d_T
    		$d_Pos = $d_T + StringLen($s_Begin)
    		$x += 1
    	Until 0
    
    
    	; Alle Tag-Enden ermitteln:
    	$x = 0
    	$d_Pos = 1
    	Do
    		$d_T = StringInStr($s_Html, $s_Ende, 2, 1, $d_Pos)
    		If $d_T = 0 Then ExitLoop
    
    
    		$a_Ends[$x] = $d_T
    		$d_Pos = $d_T + StringLen($s_Ende)
    		$x += 1
    	Until 0
    
    
    	; Funde matchen
    	Local $dMax = UBound($a_Ends) > UBound($a_Starts) ? UBound($a_Starts) - 1 : UBound($a_Ends) - 1
    	Local $d_End
    	Local $a_Return[$dMax + 1][3]
    	For $i = 0 To $dMax
    		$d_End = $a_Ends[$i]
    		For $j = $dMax To 0 Step -1
    			$d_Start = $a_Starts[$j]
    			If $d_Start = 1000000000 Then ContinueLoop
    			If $d_Start < $d_End Then
    				$a_Element = StringRegExp(StringMid($s_Html, $d_Start, $d_End - $d_Start + StringLen($s_Ende)), "(?s)^<" & $s_Type & "\s?(.*?)>(.*)</" & $s_Type, 3)
    				If UBound($a_Element) < 2 Then ContinueLoop
    				$a_Return[$i][0] = $a_Element[0]
    				$a_Return[$i][1] = $a_Element[1]
    				$a_Return[$i][2] = $d_Start
    
    
    				$a_Starts[$j] = 1000000000
    				ContinueLoop 2
    			EndIf
    		Next
    	Next
    
    
    	Return $a_Return
    EndFunc   ;==>_HtmlElements
    Alles anzeigen
  • Frage zu vergleichende Operatoren

    • AspirinJunkie
    • 4. Juni 2015 um 06:51
    Zitat von alpines

    AutoIt nimmt für jede Variable den Typ string, deshalb kann es zu Problemen bei "" und 0 führen.

    Wo hast du das denn her?
    Hier ensteht das Problem eben weil gerade eben kein Stringvergleich durchgeführt wird sondern die Daten beide als Integer behandelt werden.

    Zitat von crap_inhuman

    Heißt das, das 0 als NUL interpretiert wird ?

    Nein - die 0 bleibt wie sie ist.
    Der Leerstring wird implizit zu 0.
    Warum? - weil du Äpfel mit Birnen vergleichst:

    Du vergleichst einen String ("") mit einer Integerzahl (0).
    Wenn man unterschiedliche Datentypen miteinander vergleicht muss erst eines der beiden in den jeweiligen anderen konvertiert werden, denn nur gleiche Datentypen können verglichen werden.
    Im Fall eines Floats und eines Integers wird z.b. vor dem Vergleich der Integer in eine Float-Zahl konvertiert.
    Will man nun so etwas skurriles machen wie du - nämlich einen String mit einer Zahl zu vergleichen wird deine Abfrage implizit zu 0 = "".
    Hierzu wird der zweite Operand ("") vor dem Vergleich noch in den Datentyp des ersten Operanden (0) konvertiert. Un da Int("") nunmal 0 ergibt bleibt schlussendlich als Vergleich stehen: 0 = 0.

    Im zweiten Teil umgehst du das "Problem" in dem du statt dem =-Operator den ==-Operator verwendest. Dieser Operator erzwingt einen Stringvergleich (und zwar case sensitive). Das heißt alle Operanden werden vorher in einen String konvertiert bevor sie verglichen werden.
    Also deinem Beispiel wird implizit aus 0 == "" ein String(0) = String(""). Und da 0 in einen String konvertiert "0" ergibt, wird dein Vergleich implizit zu "0" = "" - und wird folglich False zurückgeben.

    Um dein Problem zu lösen solltest du dir Gedanken machen wie es überhaupt dazu kommt, dass du unterschiedliche Datentypen vergleichst.

  • RegEx?

    • AspirinJunkie
    • 3. Juni 2015 um 15:34

    Da wir die kompletten Daten nicht kennen (um welche Seite handelt es sich denn?) kann man das Pattern lediglich auf das Beispiel hin basteln:

    AutoIt
    #include <Array.au3>
    $s_String = '<td><a href="index.php?id=6543&screen=view">Test (12-34)</a></td>' & @CRLF & '<td>12154</td>' & "<td>asdf</td>"
    
    
    For $Match in StringRegExp($s_String, '(?s)<td><a\shref="index\.php\?id=(\d+).*?>([^<]+)<.+?<td>(\d+)', 4)
    	_ArrayDisplay($Match)
    Next
  • Welche #include - Dateien sind notwendig

    • AspirinJunkie
    • 2. Juni 2015 um 22:23

    Im Portal im Kasten Downloads findest du den Link zu OrganizeIncludes.
    Das kleine Tool checkt die Includes und dein Skript und sagt dir welche Includes du noch brauchst und welche unnötig sind.

    Zitat von Schmunzel57

    Auf die Idee mit auskommentieren, dann checken oder Programm laufen lassen und Fehler produzieren, bin ich schon gekommen - funktioniert aber nicht 100%.

    Was funktioniert daran nicht?
    Entweder es kompiliert - oder nicht.

  • PING mit Mailversand (Server Überwachen)

    • AspirinJunkie
    • 2. Juni 2015 um 10:25

    Wo ist denn dein Error-Handling für die _INetSmtpMailCom?
    Einmal @error direkt danach abfragen bzw. da es sich um ein COM-Objekt handelt folgendes noch an den Anfang des Skriptes:

    AutoIt
    ObjEvent("AutoIt.Error", "_ErrFunc")

    und dann folgende Funktion noch irgendwo im Skript unterbringen:

    AutoIt
    ; User's COM error function. Will be called if COM error occurs
    Func _ErrFunc($oError)
        ; Do anything here.
        ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _
                @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _
                @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _
                @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _
                @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _
                @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _
                @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _
                @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _
                @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
                @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF)
    EndFunc   ;==>_ErrFunc
    Alles anzeigen

    Dann solltest du verwertbare Informationen bekommen wenn die _INetSmtpMailCom() fehl schlägt.

    Edit: Sehe gerade, dass du eine eigene MyErrFunc schon registriert hast.
    Was schmeißt die für Fehlermeldungen?

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™