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. i2c

Beiträge von i2c

  • StringRegExp Array auf Index 0 setzen

    • i2c
    • 21. September 2010 um 13:04

    Funktion von BugFix

    [autoit]

    Func _ArrayDeleteEmpty(ByRef $ARRAY)
    If Not IsArray($ARRAY) Then Return 0
    Local $arTMP[1]
    For $i = 0 To UBound($ARRAY) -1
    If $ARRAY[$i] <> '' Then
    If $arTMP[0] = '' Then
    $arTMP[0] = $ARRAY[$i]
    Else
    ReDim $arTMP[UBound($arTMP)+1]
    $arTMP[UBound($arTMP)-1] = $ARRAY[$i]
    EndIf
    EndIf
    Next
    $ARRAY = $arTMP
    EndFunc

    [/autoit]
  • Mit GUICtrlRead mehrere input felder auslesen

    • i2c
    • 19. September 2010 um 20:05

    Keine Ahnung warum du da eine einzelne Variable benötigst.

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 292, 315, 192, 124)
    $Absenden = GUICtrlCreateButton("Absenden", 40, 264, 201, 33, $WS_GROUP)
    $Input1 = GUICtrlCreateInput("An", 72, 24, 137, 21)
    ;$Input2 = GUICtrlCreateInput("Nachnahme", 72, 64, 137, 21)
    $Input3 = GUICtrlCreateInput("Betreff", 72, 104, 137, 21)
    $Edit1 = GUICtrlCreateEdit("", 72, 136, 137, 105)
    GUICtrlSetData(-1, "Text")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    Func _Senden ()
    ProgressOn ("E-mail","Email wird versendet! Bitte warten!","Einstellungen auslesen.",-1,-1,2)
    ;
    ;##################################
    ; Include
    ;##################################

    [/autoit] [autoit][/autoit] [autoit]

    ;##################################
    ; Variables
    ;##################################
    $SmtpServer = "" ; address for the smtp-server to use - REQUIRED
    $FromName = "" ; name from who the email was sent
    $FromAddress = "" ; address from where the mail should come
    $ToAddress = GUICtrlRead($input1) ; destination address of the email - REQUIRED
    $Subject = GUICtrlRead($input3) ; subject from the email - can be anything you want it to be
    $Body = GUICtrlRead($Edit1) ; the messagebody from the mail - can be left blank but then you get a blank mail
    $AttachFiles = "" ; the file you want to attach- leave blank if not needed
    $CcAddress = "" ; address for cc - leave blank if not needed
    $BccAddress = "" ; address for bcc - leave blank if not needed
    $Importance = "Normal" ; Send message priority: "High", "Normal", "Low"
    $Username = "" ; username for the account used from where the mail gets sent - REQUIRED
    $Password = "" ; password for the account used from where the mail gets sent - REQUIRED
    $IPPort = 25 ; port used for sending the mail
    $ssl = 0 ; enables/disables secure socket layer sending - put to 1 if using httpS
    ;~ $IPPort=465 ; GMAIL port used for sending the mail
    ;~ $ssl=1 ; GMAILenables/disables secure socket layer sending - put to 1 if using httpS

    [/autoit] [autoit][/autoit] [autoit]

    ;##################################
    ; Script
    ;##################################

    [/autoit] [autoit][/autoit] [autoit]

    ProgressSet (50 , "E-mail wird versendet!")
    $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)
    If @error Then
    MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc)
    EndIf
    ProgressSet (100 , "Fertig!")
    Sleep (100)
    MsgBox (64,"E-mail","E-mail erfolgreich versendet!")
    ProgressOff ()
    EndFunc
    ;
    ; The UDF
    Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
    Local $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress
    Local $i_Error = 0
    Local $i_Error_desciption = ""
    If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
    If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress
    $objEmail.Subject = $s_Subject
    If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then
    $objEmail.HTMLBody = $as_Body
    Else
    $objEmail.Textbody = $as_Body & @CRLF
    EndIf
    If $s_AttachFiles <> "" Then
    Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
    For $x = 1 To $S_Files2Attach[0]
    $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x])
    ConsoleWrite('@@ Debug(62) : $S_Files2Attach = ' & $S_Files2Attach & @LF & '>Error code: ' & @error & @LF) ;### Debug Console
    If FileExists($S_Files2Attach[$x]) Then
    $objEmail.AddAttachment ($S_Files2Attach[$x])
    Else
    ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF)
    SetError(1)
    Return 0
    EndIf
    Next
    EndIf
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
    If Number($IPPort) = 0 then $IPPort = 25
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort
    ;Authenticated SMTP
    If $s_Username <> "" Then
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
    EndIf
    If $ssl Then
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    EndIf
    ;Update settings
    $objEmail.Configuration.Fields.Update
    ; Set Email Importance
    Switch $s_Importance
    Case "High"
    $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "High"
    Case "Normal"
    $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Normal"
    Case "Low"
    $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Low"
    EndSwitch
    $objEmail.Fields.Update
    ; Sent the Message
    $objEmail.Send
    If @error Then
    SetError(2)
    Return $oMyRet[1]
    EndIf
    $objEmail=""
    EndFunc ;==>_INetSmtpMailCom
    ;
    ;
    ; Com Error Handler
    Func MyErrFunc()
    $HexNumber = Hex($oMyError.number, 8)
    $oMyRet[0] = $HexNumber
    $oMyRet[1] = StringStripWS($oMyError.description, 3)
    ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF)
    SetError(1); something to check for when this function returns
    Return
    EndFunc ;==>MyErrFunc

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]
  • Mit GUICtrlRead mehrere input felder auslesen

    • i2c
    • 19. September 2010 um 19:08
    &quot;Beispiel&quot;
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <array.au3>
    Global $aInput[4]
    $Form1 = GUICreate("Form1", 500, 500, -1, -1)
    $aInput[0] = GUICtrlCreateInput("", 20, 20)
    $aInput[1] = GUICtrlCreateInput("", 20, 40)
    $aInput[2] = GUICtrlCreateInput("", 20, 60)
    $aInput[3] = GUICtrlCreateInput("", 20, 80)
    $Button1 = GUICtrlCreateButton("start", 260, 50)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    Dim $aOut[1]
    For $i = 0 To UBound($aInput)-1
    _ArrayAdd($aOut, GUICtrlRead($aInput[$i]))
    Next
    _ArrayDisplay($aOut)
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit]
  • array, inhalt & minuten

    • i2c
    • 19. September 2010 um 19:00

    Stringleft($string, 5)

  • array, inhalt & minuten

    • i2c
    • 19. September 2010 um 18:26

    Mir erschliesst sich nicht ganz, warum man das unbedingt in 3 Funktionen aufteilen muss.

  • array, inhalt & minuten

    • i2c
    • 19. September 2010 um 16:12

    Kein Windows parat um das zu testen.

    &quot;ungetesteter Ansatz&quot;
    [autoit]

    #include <array.au3>
    #include <Date.au3>
    #include "ArrayMore.au3"
    Global $aTitle[1][2]

    [/autoit] [autoit][/autoit] [autoit]

    AdlibRegister("_bla")

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    Sleep(100)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _bla()
    $active = WinGetTitle("[active]")
    If $active <> "" Then
    $find = _ArraySearch($aTitle, $active, 0, 0, 1, 1, 0)
    If $find = -1 And @error = 6 Then
    _Array2DAdd($aTitle, $active & "|" & _NowCalc())
    ElseIf $find >= 0 Then
    If _DateDiff('n', $aTitle[$find][1], _NowCalc()) >= 10 Then
    _array2ddelete($aTitle, $find)
    EndIf
    EndIf
    EndIf
    EndFunc

    [/autoit]


    Die ArrayMore.au3 findest du über die Forensuche

  • esten Buchstaben

    • i2c
    • 19. September 2010 um 03:28

    Hachja, die flags von FileOpen() werd ich hoffentlich auch irgendwann mal in meinen Kopf bekommen. Ist ja nicht das erste mal das ich die durcheinander bringe :rolleyes: .

    Ich hatte es so verstanden, das alle Leerstellen entfernt werden sollen. Wenn ich jetzt nochmal über Alinas Beitrag lese, kommen bei mir allerdings Zweifel auf. Sei's drum. Hab das Beispiel oben mal angepasst, der flag eine Variable zugeordnet und die Beschreibung aus der deutschen Hilfe mit eingesetzt.

    wie immer ... danke autoBert :thumbup:

  • esten Buchstaben

    • i2c
    • 19. September 2010 um 01:30

    Kann dich da beruhigen. Hatte einen kleinen Fehler drin.
    Beim _ArrayToString() habe ich nicht Index 1 als Startelement gesetzt. In Index 0 steht ja etwas, das man in der Ausgabe nicht haben will. Hab's jetzt mal korigiert.
    Es gibt dafür sicher noch elegantere Möglichkeiten. Das war jetzt nur die erste, spontane Eingebung.

  • esten Buchstaben

    • i2c
    • 19. September 2010 um 01:05
    Spoiler anzeigen
    [autoit]


    #include <array.au3>
    #include <File.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $aFile

    [/autoit] [autoit][/autoit] [autoit]

    $input = "test.txt"
    $output = "output.txt"

    [/autoit] [autoit][/autoit] [autoit]

    ;Flag zum Kennzeichnen der Art des Entfernens von Leerstellen(für mehrere Arten werden die Flags addiert):
    ;1 = entferne führende Leerstellen
    ;2 = entferne nachfolgende Leerstellen
    ;4 = entferne doppelte (oder mehr) Leerstellen zwischen den Zeichen
    ;8 = entferne alle Leerstellen (überschreibt alle anderen Flags)
    $stripWS = 7

    [/autoit] [autoit][/autoit] [autoit]

    _FileReadToArray($input, $aFile)
    $hOutput = FileOpen($output, 2)
    If IsArray($aFile) Then
    For $i = 1 To $aFile[0]
    $aSplit = StringSplit($aFile[$i], ";")
    If IsArray($aSplit) Then
    For $j = 1 To $aSplit[0]
    $aSplit[$j] = StringLeft(StringStripWS($aSplit[$j],$stripWS), 7)
    Next
    FileWrite($hOutput, _ArrayToString($aSplit, ";", 1) & @CRLF)
    EndIf
    Next
    EndIf
    FileClose($hOutput)

    [/autoit]

    Hoffe das entspricht in etwa den Anforderungen.

    &quot;test.txt&quot;
    Code
    1 43294  9506 ; Musterwochentag ;Sonntag  abend;Butte  rbrot ; Sa  nekuchen
     14329 49506; Musterw  ochentag;Sonn tagabend;Butterbrot ; Sahneku  chen
    1 432949 506; Must   erwochentag;Sonntaga  bend;Bu  tterbrot ; Sahnekuchen
    &quot;output.txt bei $stripWS=8&quot;
    Code
    1432949;Musterw;Sonntag;Butterb;Sanekuc
    1432949;Musterw;Sonntag;Butterb;Sahneku
    1432949;Musterw;Sonntag;Butterb;Sahneku
  • Happy Birthday Gun-Food! :-)

    • i2c
    • 19. September 2010 um 00:30

    [Blockierte Grafik: http://www.abload.de/img/oi6n8toor5wp.gif]

    Zu Deinem Geburtstag ein kurzes Gedicht:
    Du bist ein Jahr älter - ich bin's noch nicht! :P

    Alles Gute zum Geburtstag Gun-Food!

  • Listview Probleme mit _GUICtrlListView_DeleteAllItems

    • i2c
    • 18. September 2010 um 23:34

    Könnte das funktionieren?

    [autoit]

    For $iBilder = 0 To 255
    _GUIImageList_AddIcon($hImage, @SystemDir & "\" & $sDLLName, $iBilder)
    Next
    If _GUIImageList_GetImageCount($hImage) = 0 Then
    Return
    EndIf

    [/autoit]
  • Listview Probleme mit _GUICtrlListView_DeleteAllItems

    • i2c
    • 18. September 2010 um 22:16

    Ich kann's mangels Windows System nicht testen aber löst evtl.

    [autoit]

    _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listview))

    [/autoit]


    das Problem?

  • fremde listview auslesen

    • i2c
    • 18. September 2010 um 01:03

    Da wird's mit dem Helfen schwierig. Man kennt weder deine Code noch weiss man, um welche Listview es geht.

  • Suche guten Browser

    • i2c
    • 13. September 2010 um 16:45

    In Schnitzels Liste fehlt bei Opera mindestens noch die Opera Unity Dienste und Opera Turbo, der mir an manch einem Tag das Leben mit meinem UMTS Sticks angenehmer gemacht hat. Opera Dragonfly hat bei mir die Webdeveloper Tools von Firefox mittlerweile komplett ersetzt (das handling ist einfach angenehmer).

    Firefox ist was für Leute die entweder ein gutes, kompaktes Browserpaket wollen oder für die Individualisten die sich ihren Internetknecht gerne mit massig Addons zupflastern. Eine echte Alternative wird er für mich persönlich aber erst wieder, wenn sich in Sachen Geschwindigkeit bis zur finalen 4ten Version noch einiges tut.

    Und hackt doch nicht immer so auf dem armen Google Chrome rum. Wenn man weiss wie es geht lässt sich der Datenkrake relativ leicht zähmen.

  • 2 scripte zusammenfügen

    • i2c
    • 10. September 2010 um 23:21

    du könntest dich eines Startparameters bedienen.
    Vor dem Neustart erstellst du einen Autostart Eintrag für das Skript und hängst einen Parameter an. Im Skript selbst prüfst du per If $CMDLINE[0] ob der Parameter vorhanden ist oder nicht und führst dementsprechend den passenden Skriptteil aus.

  • Probleme beim Löschen einer ListBox

    • i2c
    • 9. September 2010 um 22:45
    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GUIListBox.au3>
    #include <WindowsConstants.au3>
    #region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 317, 233, 192, 124)
    $List1 = GUICtrlCreateList("", 8, 8, 169, 201)
    GUICtrlSetData(-1, "Text1|Text2|Text3|Text4|Text5")
    $deleteall = GUICtrlCreateButton("Alle Löschen", 184, 16, 75, 25, $WS_GROUP)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $deleteall
    _GUICtrlListBox_ResetContent($List1)
    EndSwitch
    WEnd

    [/autoit]
  • Musikerkennungs software gesucht ...

    • i2c
    • 9. September 2010 um 19:07

    Ich kenn keine Software aber den Titel: Karate High School - And Then You Die

    edit: anno übersehen :S

  • Autoitbefehle aus txt oder dll lesen

    • i2c
    • 9. September 2010 um 12:36
    [autoit]

    $string = 'Msgbox(0, "", "Hallo Welt")'
    Execute($string)

    [/autoit]
  • Im Firefox den Proxy auf "kein Proxy" stellen?

    • i2c
    • 7. September 2010 um 23:57

    Könntest du über die FF.au3 erledigen - _FFPrefSet() (Dokumentation mit Skriptbeispiel findest du ebenfalls auf der Seite)
    Oder du screibst dir eine eigene kleine Funktion, die in den Firefox Konfigurationsdateien den Wert für http://www.autoitscript.com/forum/index.ph…work.proxy.http verändert. Beispiel

  • Addition von CSV-Dateien

    • i2c
    • 7. September 2010 um 22:07

    Achtung: Pseudo. Hab die Flags grad nicht im Kopf.

    [autoit]

    $list=_FileListToArray($pfad, "*.bll")
    $ausgabe = "ausgabe.csv"
    $hAusgabe=FileOpen($ausgabe, 2)
    For $i = 1 To $list[0]
    FileWrite($hAusgabe,FileRead($list[0])
    Next
    FileClose($hAusgabe)

    [/autoit]

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™