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

Beiträge von Xenobiologist

  • Einfaches Skript - läuft als 32bit nicht auf 64bit

    • Xenobiologist
    • 24. September 2009 um 09:14

    Hi,

    bei mir kein Problem. ?(

    XP 32 bit !

    Mega

  • Problem mit Sonderzeichen (@)

    • Xenobiologist
    • 23. September 2009 um 13:19

    Hi,

    schon mal ControlSetText ptobiert?

    Mega

  • Interprocess Kommunikation

    • Xenobiologist
    • 22. September 2009 um 17:21

    Welche Anwendung ist es denn? Kannst du die exe aufrufen in einer DosBox mit -? oder sowas?

    Mega

  • Zusammenarbeit 1x Checkbox, 2x Radio, 1x Inputfeld und ein Kalenderelement (Date)

    • Xenobiologist
    • 21. September 2009 um 19:00

    Also 1. ist es sehr ungewöhnlich auf die Auswahl eines Radiobuttons etwas in eine Datei zu schreiben :D
    Das beides drin steht ist von dir so beschrieben.
    Wenn 1 - dann hinzufügen, wenn 2 dann alles löschen und nur 2 reinschreiben.

    Was ich eingebaut habe sollte folgendes:

    Der WMCommand verhindert die Eingabe von Werten größer 1899 ohne zusätzliche Arbeit für dich. Sehr praktisch
    Die Checkboxabfrage sollte nur zeigen, dass man für wiederkehrende Aufgaben Funktionen schreiben sollte und möglichst wenig Code in der Whilfe, da diese ansonsten lang und unübersichtlich wird. Außer besser auslagern in Funktionen.

    Mega

  • Zusammenarbeit 1x Checkbox, 2x Radio, 1x Inputfeld und ein Kalenderelement (Date)

    • Xenobiologist
    • 21. September 2009 um 18:40

    HI,

    habe dir 2 kleine Vorschläge eingebaut.

    Spoiler anzeigen
    [autoit]

    #include <File.au3>
    #include <GUIConstantsEx.au3>
    #include <EditConstants.au3>
    #include <WinAPI.au3>
    #include <WindowsConstants.au3>
    #cs
    Script Nr. 17 von 81 für Projekt "Grafische Oberfläche X_26"
    #ce

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("44_45_46_47_CB_RB_RB", 362, 80, 193, 125)
    $Checkbox46 = GUICtrlCreateCheckbox("Checkbox46", 5, 5, 89, 15)
    $Radio1 = GUICtrlCreateRadio("Radio60", 100, 5, 60, 15)
    $Radio2 = GUICtrlCreateRadio("Radio61", 100, 28, 57, 15)
    $Input23 = GUICtrlCreateInput("1899", 165, 2, 33, 21, $ES_NUMBER)
    GUICtrlSetLimit(-1, 4)
    $Date1 = GUICtrlCreateDate("2009/09/21 16:08:49", 165, 25, 186, 21)
    $Button1 = GUICtrlCreateButton(" A U S G A B E ", 5, 48, 346, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    GUICtrlSetState($Radio1, $GUI_DISABLE)
    GUICtrlSetState($Radio2, $GUI_DISABLE)

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

    GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Checkbox46
    _changeState($Checkbox46, $Radio1)
    _changeState($Checkbox46, $Radio2)
    Case $Radio1
    If GUICtrlSetState($Radio1, $GUI_CHECKED) Then
    $fH = FileOpen(@ScriptDir & "\44_45_46_47.txt", 1)
    FileWrite($fH, GUICtrlRead($Input23))
    FileClose($fH)
    MsgBox(0, "MELDUNG", GUICtrlRead($Input23)) ; nur zum testen
    EndIf
    Case $Radio2
    If GUICtrlSetState($Radio2, $GUI_CHECKED) Then
    Local $Date1, $DTM_SETFORMAT_, $style, $1_day ; ----------------> Anfang : ;Example_date1()
    ; Um ein bestimmtes Standardformat auszuwählen
    $DTM_SETFORMAT_ = 0x1032
    $style = "dd.MM.yyyy"; HH:mm:s"
    GUICtrlSendMsg($Date1, $DTM_SETFORMAT_, 0, $style)
    GUISetState()
    $1_day = StringSplit(GUICtrlRead($Date1), ".", 1)
    $fH = FileOpen(@ScriptDir & "\44_45_46_47.txt", 2)
    FileWrite($fH, $1_day[3] & $1_day[2] & $1_day[1])
    FileClose($fH)
    MsgBox(0, "Zeit", $1_day[3] & $1_day[2] & $1_day[1]) ; ----------------> Ende : ;Example_date1() ; nur zum testen
    EndIf

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

    Case $Button1
    EndSwitch
    WEnd

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

    Func MY_WM_COMMAND($hWnd, $msg, $wParam, $lParam)
    Local $controlID = _WinAPI_LoWord($wParam)
    If $controlID = $Input23 Then
    If GUICtrlRead($Input23) > 1899 Then GUICtrlSetData($Input23, 1899)
    MsgBox(16, "MELDUNG", "Wert maximal 1899", 3)
    ; hier jegliche Logik rein.
    EndIf
    EndFunc ;==>MY_WM_COMMAND

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

    Func _changeState($cID, $C1)
    If GUICtrlRead($cID) = $GUI_CHECKED Then
    GUICtrlSetState($C1, $GUI_ENABLE)
    Else
    GUICtrlSetState($C1, $GUI_DISABLE)
    EndIf
    EndFunc ;==>_changeState

    [/autoit]
  • Datumszeitrum aus Strings erkennen.

    • Xenobiologist
    • 21. September 2009 um 17:53

    Hi,

    hier mal ein kurzer Autoitversuch:

    Spoiler anzeigen
    [autoit]

    Opt('MustDeclareVars', 1)
    Local $buffer, $date, $start, $end, $file, $info, $rows
    $start = "20090908"
    $end = "20090910"
    $file = FileRead('log.log')
    $info = StringRegExpReplace(StringRegExpReplace($file, ',\d\d:\d\d:\d\d', ''), '(\d\d)\.(\d\d)\.(\d{4})', '\3\2\1')
    $rows = StringSplit($info, @LF)

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

    For $i = 0 To UBound($rows) - 1
    $date = StringLeft($rows[$i], 8)
    If $date >= $start And $date <= $end Then
    $buffer &= $rows[$i] & @CRLF
    EndIf
    Next

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

    StringReplace($buffer, 'a', '')
    ConsoleWrite('Meldung a = ' & @extended & @CRLF)
    StringReplace($buffer, 'b', '')
    ConsoleWrite('Meldung b = ' & @extended & @CRLF)

    [/autoit]

    Mega

  • Datumszeitrum aus Strings erkennen.

    • Xenobiologist
    • 21. September 2009 um 17:03

    HI,

    alles klar. Eine einfach Möglichkeit wäre zum Beispiel einfach Excel 2007 zu nutzen. Da kannst beliebig filtern und zählen.

    Aber geht auch mit Autoit :)

    Mega

  • Datumszeitrum aus Strings erkennen.

    • Xenobiologist
    • 21. September 2009 um 14:51

    Hi,

    kannst du das Log zippen und hochladen? Dann kann man mal schnell testen. Es sollte schneller gehen.

    Mega

  • Datumszeitrum aus Strings erkennen.

    • Xenobiologist
    • 21. September 2009 um 11:39

    Rechne z.B. mit DateDiff die Differenz zwischen Start und Ende aus. Wenn jetzt ein Datum kommt, dann rechnest du auch hier und vergleichst. Wenn späer als start und kleiner als Diff bis Ende, dann liegt es dazwischen.

    Mega

  • Ordner / Eigenschaften

    • Xenobiologist
    • 18. September 2009 um 09:40

    Ich würde sowas nicht Bot nennen. Du kannst ID3 Tags bearbeiten.

  • Fenster in der Mitte des Desktop anzeigen lassen mit den erweiterungen ($WS_POPUP,$WS_EX_TOOLWINDOW)

    • Xenobiologist
    • 16. September 2009 um 21:54

    Hi,

    du musst einfach die Koordinaten berechnen.

    @Desktopheight / 2 - hälfte der Höhe deiner GUI
    @Desktopwidth / 2 - hälfte der Breite deiner GUI

    Mega

  • Problem bei UDP Scripten...

    • Xenobiologist
    • 16. September 2009 um 21:49

    Hi,

    warum nutzt du nicht TCP. Dafür gibt es doch schon zig laufende Beispiele. Ich habe letztens gerade noch eins gemacht für unsere Praktikantin. :D

    Mega

  • GUI Zeit Programm läuft seit ddd | hh:mm:ss

    • Xenobiologist
    • 16. September 2009 um 16:41

    Hi,

    beu sowas ein.

    Spoiler anzeigen
    [autoit]

    ; Stoppuhr

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

    #include<Date.au3>
    Opt('MustDeclareVars', 1)
    HotKeySet('{esc}', '_end')
    HotKeySet('{Pause}', '_stop')

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

    Global $time = _NowTime()

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

    While 1
    ToolTip('Stoppuhr' & @CRLF & '============' & @CRLF & _counter(_NowCalcDate(), $time) & ' left', _
    @DesktopWidth - 100, 30)
    Sleep(1)
    WEnd

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

    Func _stop()
    While 1
    Sleep(100)
    WEnd
    EndFunc ;==>_stop

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

    Func _counter($s_Date, $s_time)
    Local $returnValue = ''
    If Not _DateIsValid($s_Date & ' ' & $s_time) Then Return -1
    Local $NumberOfSeconds = _DateDiff('s', $s_Date & ' ' & $s_time, _NowCalc())
    Return StringFormat('Days = %.02d' & @CRLF & 'Hours = %.02d' & @CRLF & 'Min = %.02d' & @CRLF & 'Sec = %.02d' & @CRLF & _
    'Msec = %.03d', $NumberOfSeconds / 86400, Mod($NumberOfSeconds / 3600, 24), Mod(($NumberOfSeconds / 60), 60), _
    Mod($NumberOfSeconds, 60), _MSec())
    EndFunc ;==>_counter

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

    Func _MSec()
    Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort')
    DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime))
    Local $sMilliSeconds = StringFormat('%03d', DllStructGetData($stSystemTime, 8))
    $stSystemTime = 0
    Return $sMilliSeconds
    EndFunc ;==>_MSec

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

    Func _end()
    Exit (0)
    EndFunc ;==>_end

    [/autoit]

    P.S.: der Code ist alt, mittlerweile gibt es auch @Msec

    Mega

  • Das Aktuelle SciTe Editor Script aus SciTe Lesen?

    • Xenobiologist
    • 15. September 2009 um 18:46

    http://www.autoitscript.com/forum/index.php?showtopic=22636
    http://www.autoitscript.com/forum/index.php?showtopic=61974
    http://www.autoitscript.com/forum/index.php?showtopic=25029

    Spoiler anzeigen
    [autoit]

    #include <WindowsConstants.au3>
    Opt('WinSearchChildren', 1)

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

    Global $SciTECmd = 0
    $GUI = GUICreate('test')

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

    ; Get SciTE DirectorHandle
    $Scite_hwnd = WinGetHandle('DirectorExtension')
    GUIRegisterMsg($WM_COPYDATA, 'MY_WM_COPYDATA')
    $My_Dec_Hwnd = Dec(StringTrimLeft($GUI, 2))

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

    Global $opt = Opt('WinTitleMatchMode', 4)
    SendSciTE_Command($My_Dec_Hwnd, $Scite_hwnd, 'askfilename:')
    ConsoleWrite($SciTECmd & @CRLF)
    $SciTECmd = StringReplace($SciTECmd, '\\', '\')
    ; ConsoleWrite($SciTECmd & @CRLF) ; Ausgabe kompletter Rückgabewert von askfilename:
    Global $FilePath = StringTrimLeft($SciTECmd, StringInStr($SciTECmd, ':', Default, 3))
    ;MsgBox(0, '', $FilePath) ; Ausgabe Dateipfad
    Global $FileName = StringSplit($SciTECmd, '\\')
    ;SendSciTE_Command($My_Dec_Hwnd, $Scite_hwnd, 'output:' & $FileName) ; Ausgabe des Dateinamens in die Console
    SendSciTE_Command($My_Dec_Hwnd, $Scite_hwnd, 'menucommand:106') ; save
    SendSciTE_Command($My_Dec_Hwnd, $Scite_hwnd, 'menucommand:106') ; revert
    Opt('WinTitleMatchMode', $opt)

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

    ; Open File
    Local $h_file = FileOpen($FilePath, 0)
    If $h_file = -1 Then
    MsgBox(16, 'Error', 'Could not open file : ' & $FilePath, 5)
    Exit (0)
    EndIf
    ; Read file
    $source = FileRead($h_file)
    If @error > 0 Then
    MsgBox(16, 'Error', 'Could not read file : ' & $FilePath, 5)
    Exit (0)
    EndIf
    FileClose($h_file)
    MsgBox(64, 'Source', $source)

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

    ; Send command to SciTE
    Func SendSciTE_Command($My_Hwnd, $Scite_hwnd, $sCmd)
    $sCmd = ':' & $My_Dec_Hwnd & ':' & $sCmd
    ;ConsoleWrite('-->' & $sCmd & @LF)
    Local $CmdStruct = DllStructCreate('Char[' & StringLen($sCmd) + 1 & ']')
    DllStructSetData($CmdStruct, 1, $sCmd)
    Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr')
    DllStructSetData($COPYDATA, 1, 1)
    DllStructSetData($COPYDATA, 2, StringLen($sCmd) + 1)
    DllStructSetData($COPYDATA, 3, DllStructGetPtr($CmdStruct))
    DllCall('User32.dll', 'None', 'SendMessage', 'HWnd', $Scite_hwnd, _
    'Int', $WM_COPYDATA, 'HWnd', $My_Hwnd, _
    'Ptr', DllStructGetPtr($COPYDATA))
    EndFunc ;==>SendSciTE_Command

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

    ; Received Data from SciTE
    Func MY_WM_COPYDATA($hWnd, $msg, $wParam, $lParam)
    Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr', $lParam)
    Local $SciTECmdLen = DllStructGetData($COPYDATA, 2)
    Local $CmdStruct = DllStructCreate('Char[255]', DllStructGetData($COPYDATA, 3))
    $SciTECmd = StringLeft(DllStructGetData($CmdStruct, 1), $SciTECmdLen)
    EndFunc ;==>MY_WM_COPYDATA

    [/autoit]
  • Das Aktuelle SciTe Editor Script aus SciTe Lesen?

    • Xenobiologist
    • 15. September 2009 um 16:48

    Hi,

    ich bin derzeit dabei das Thema Organize Includes im Eng Forum im versteckten MVP Forum mit Jos & anderen zu besprechen.
    Danach werde ich mit der Umsetzung beginnen. Ziel ist es OI schnell zu machen und dann in Scite4Autoit zu integrieren.
    Dafür gibt es aber noch einige Details zu klären bevor ich anfangen kann.
    Die Umsetzung wird dann sicher auch noch jede Menge Zeit in Ansoruch nehmen.

    Was willst du denn noch enbauen, außer das Finden der richtigen includes?

    Mega

  • [Offtopic]AutoIt Beta - Ja oder Nein

    • Xenobiologist
    • 8. September 2009 um 07:25

    HI,

    ganz klar BETA!
    Der Name BETA ist einfach schlecht gewählt. Eigentlich handelt es sich immer um eine Weiterentwicklung der Stabel nur mit der Option mal schnell wieder Änderungen rückgängig zu machen. Das kann aber immer passieren und wenn dann ist sicher auch sinnvoll.

    Mega

  • _INetSmtpMail-Problem

    • Xenobiologist
    • 8. September 2009 um 07:23

    Nimm mal dies zum Test

    Spoiler anzeigen
    [autoit]

    #include <INet.au3>

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

    $s_SmtpServer = "mail.gmx.net"
    $s_FromName = "xxx"
    $s_FromAddress = "xxx@gmx.de"
    $s_ToAddress = "XXX"
    $s_Subject = "My Test UDF"
    $s_UName = "xxx@gmx.de"
    $s_PWD = "xxx"
    #cs
    $arIniRead = IniReadSection(@ScriptDir & '\mails.ini', "mail")
    $s_SmtpServer = $arIniRead[1][1]
    $s_FromName = $arIniRead[2][1]
    $s_FromAddress = $arIniRead[3][1]
    $s_ToAddress = $arIniRead[4][1]
    $s_Subject = $arIniRead[5][1]
    $s_UName = $arIniRead[6][1]
    $s_PWD = $arIniRead[7][1]
    MsgBox(0, "", $s_SmtpServer & ' ' & $s_FromName & ' ' & $s_FromAddress & ' ' & $s_ToAddress & ' ' & $s_Subject & ' ' & $s_UName & ' ' & $s_PWD)
    #ce

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

    Dim $as_Body[2]
    $as_Body[0] = "Testing the new email udf"
    $as_Body[1] = "Second Line"
    $Response = _INetSmtpMailAuth($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_UName, $s_PWD, $s_Subject, $as_Body)
    ;~ $Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
    $err = @error
    If $Response = 1 Then
    MsgBox(0, "Success!", "Mail sent")
    Else
    MsgBox(0, "Error!", "Mail failed with error code " & $err)
    EndIf

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

    ;===============================================================================
    ;
    ; Function Name: _INetSmtpMailAuth()
    ; Description: Sends an email using SMTP over TCP IP.
    ; Parameter(s): $s_SmtpServer - SMTP server to be used for sending email
    ; $s_FromName - Name of sender
    ; $s_FromAddress - eMail address of sender
    ; $s_ToAddress - Address that email is to be sent to
    ; $s_Username - Username for Authentication (bernd670)
    ; $s_Passwd - Password for Authentication (bernd670)
    ; $s_Subject - Subject of eMail
    ; $as_Body - Single dimension array containing the body of eMail as strings
    ; $s_helo - Helo identifier (default @COMPUTERNAME) sometime needed by smtp server
    ; $s_first - send before Helo identifier (default @CRLF) sometime needed by smtp server
    ; $b_trace - trace on a splash window (default 0 = no trace)
    ; Requirement(s): None
    ; Return Value(s): On Success - Returns 1
    ; On Failure - 0 and sets
    ; @ERROR = 1 - Invalid Parameters
    ; @ERROR = 2 - Unable to start TCP
    ; @ERROR = 3 - Unable to resolve IP
    ; @ERROR = 4 - Unable to create socket
    ; @ERROR = 5x - Cannot open SMTP session
    ; @ERROR = 50x - Cannot send body
    ; @ERROR = 5000 - Cannot close SMTP session
    ; Authors: Original function to send email via TCP - Asimzameer
    ; Conversion to UDF - Walkabout
    ; Correction Helo, timeout, trace - Jpm
    ; Correction send before Helo - Jpm
    ; Include Authentication - bernd670
    ;
    ;===============================================================================
    Func _INetSmtpMailAuth($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Username, $s_Passwd, $s_Subject = "", $as_Body = "", $s_helo = "", $s_first = "-1", $b_trace = 0)

    Local $v_Socket
    Local $s_IPAddress
    Local $i_Count
    Local $s_Send[9]
    Local $s_ReplyCode[9];Return code from SMTP server indicating success

    If $s_SmtpServer = "" Or $s_FromAddress = "" Or $s_ToAddress = "" Or $s_Username = "" Or $s_Passwd = "" Or $s_FromName = "" Or StringLen($s_FromName) > 256 Then
    SetError(1)
    Return 0
    EndIf
    If $s_helo = "" Then $s_helo = @ComputerName
    If TCPStartup() = 0 Then
    SetError(2)
    Return 0
    EndIf
    StringRegExp($s_SmtpServer, "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")
    If @extended Then
    $s_IPAddress = $s_SmtpServer
    Else
    $s_IPAddress = TCPNameToIP($s_SmtpServer)
    EndIf
    If $s_IPAddress = "" Then
    TCPShutdown()
    SetError(3)
    Return 0
    EndIf
    $v_Socket = TCPConnect($s_IPAddress, 25)
    If $v_Socket = -1 Then
    TCPShutdown()
    SetError(4)
    Return (0)
    EndIf

    $s_Send[0] = "EHLO " & $s_helo & @CRLF
    ;~ If StringLeft($s_helo,5) <> "EHLO " Then $s_Send[0] = "EHLO " & $s_helo & @CRLF
    $s_ReplyCode[0] = "250"

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

    $s_Send[1] = "AUTH LOGIN" & @CRLF
    $s_ReplyCode[1] = "334"
    $s_Send[2] = _Base64Encoding($s_Username) & @CRLF
    $s_ReplyCode[2] = "334"
    $s_Send[3] = _Base64Encoding($s_Passwd) & @CRLF
    $s_ReplyCode[3] = "235"
    $s_Send[4] = "MAIL FROM: <" & $s_FromAddress & ">" & @CRLF
    $s_ReplyCode[4] = "250"
    $s_Send[5] = "RCPT TO: <" & $s_ToAddress & ">" & @CRLF
    $s_ReplyCode[5] = "250"
    $s_Send[6] = "DATA" & @CRLF
    $s_ReplyCode[6] = "354"

    $s_Send[7] = "From: " & $s_FromName & " <" & $s_FromAddress & ">" & @CRLF & _
    "To: " & "<" & $s_ToAddress & ">" & @CRLF & _
    "Subject: " & $s_Subject & @CRLF & _
    "Mime-Version: 1.0" & @CRLF & _
    "Content-Type: text/plain; charset=US-ASCII" & @CRLF & _
    @CRLF
    $s_ReplyCode[7] = ""

    $s_Send[8] = @CRLF & "." & @CRLF
    $s_ReplyCode[8] = "250"

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

    ; open stmp session
    If _SmtpSend($v_Socket, $s_Send[0], $s_ReplyCode[0], $b_trace, "220", $s_first) Then
    SetError(50)
    Return 0
    EndIf

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

    ; send header
    For $i_Count = 0 To UBound($s_Send) - 2
    If _SmtpSend($v_Socket, $s_Send[$i_Count], $s_ReplyCode[$i_Count], $b_trace) Then
    SetError(50 + $i_Count)
    Return 0
    EndIf
    Next

    ; send body records (a record can be multiline : take care of a subline beginning with a dot should be ..)
    For $i_Count = 0 To UBound($as_Body) - 1
    ; correct line beginning with a dot
    If StringLeft($as_Body[$i_Count], 1) = "." Then $as_Body[$i_Count] = "." & $as_Body[$i_Count]

    If _SmtpSend($v_Socket, $as_Body[$i_Count] & @CRLF, "", $b_trace) Then
    SetError(500 + $i_Count)
    Return 0
    EndIf
    Next

    ; close the smtp session
    $i_Count = UBound($s_Send) - 1
    If _SmtpSend($v_Socket, $s_Send[$i_Count], $s_ReplyCode[$i_Count], $b_trace) Then
    SetError(5000)
    Return 0
    EndIf

    TCPCloseSocket($v_Socket)
    TCPShutdown()
    Return 1
    EndFunc ;==>_INetSmtpMailAuth

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

    ;===============================================================================
    ;
    ; Function Name: _Base64Encoding()
    ; Description: Kodiert eine Zeichenfolge mit dem Base64-Verfahren
    ; (http://de.wikipedia.org/wiki/Base64)
    ; Parameter(s): $String - Zeichenfolge die kodiert werden soll
    ; Requirement(s): None
    ; Return Value(s): Kodierte Zeichenfolge
    ; Authors: bernd670
    ;
    ;===============================================================================
    Func _Base64Encoding($String)

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

    $strUmsetzung = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
    $strRetValue = ""

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

    For $i = 1 To StringLen($String) Step 3
    $strTok = StringMid($String, $i, 3)
    Switch StringLen($strTok)
    Case 3
    $iTokVal = (Asc(StringMid($strTok, 1, 1)) * 256 + _
    Asc(StringMid($strTok, 2, 1))) * 256 + _
    Asc(StringMid($strTok, 3, 1))
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $strRetValue &= $strTokCryt

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

    Case 2
    $iTokVal = (Asc(StringMid($strTok, 1, 1)) * 256 + _
    Asc(StringMid($strTok, 2, 1))) * 256
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $strRetValue &= $strTokCryt & "="

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

    Case 1
    $iTokVal = Asc(StringMid($strTok, 1, 1)) * 65536
    $iTokVal = BitShift($iTokVal, 12)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
    $iTokVal = BitShift($iTokVal, 6)
    $strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
    $strRetValue &= $strTokCryt & "=="

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

    EndSwitch
    Next

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

    Return $strRetValue
    EndFunc ;==>_Base64Encoding

    [/autoit]

    Mega

  • mauspositionen im array speichern

    • Xenobiologist
    • 7. September 2009 um 16:31

    Drück mal in Scite Alt+F6

  • AutoIt + WinSCP = leichte Verzweiflung

    • Xenobiologist
    • 7. September 2009 um 15:06

    Hi,

    alles kein Problem. Du solltest dir aber zunächst genau überlegen wie der Ablauf sein soll.

    1. Dateidownlod
    2. spreichern
    3. ...

    Mega

  • etwas auf einer liste ausgeben

    • Xenobiologist
    • 5. September 2009 um 22:58

    Sowas?

    Spoiler anzeigen
    [autoit]

    $permutarray = permute("abc")
    $msg = ""
    For $n = 1 To $permutarray[0]
    $msg &= $permutarray[$n] & @CRLF
    Next
    ConsoleWrite($msg)

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

    Func rotate($sString, $nRotateLevel)
    Local $aStringArray = StringSplit($sString, "")
    Local $nStartRotate = $aStringArray[0] - $nRotateLevel + 1
    Local $n, $tempchar, $tempstr = "", $retval = ""
    For $n = 1 To $nStartRotate - 1
    $tempstr &= $aStringArray[$n]
    Next
    $tempchar = $aStringArray[$nStartRotate]
    For $n = $nStartRotate + 1 To $aStringArray[0]
    $retval &= $aStringArray[$n]
    Next
    Return $tempstr & $retval & $tempchar
    EndFunc ;==>rotate

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

    Func permute_internal($sString, $nRotateLevel, ByRef $permutations)
    Local $n, $str
    Dim $arr[$nRotateLevel]
    If $nRotateLevel = 2 Then
    $permutations &= ":" & rotate($sString, $nRotateLevel)
    Return
    EndIf
    $str = $sString
    For $n = 0 To $nRotateLevel - 1
    $str = rotate($str, $nRotateLevel)
    $arr[$n] = $str
    ;--- special check, to stop a level beeing printed twice ---
    If Not (($n = 0) And (StringLen($sString) > $nRotateLevel)) Then
    $permutations &= ":" & $arr[$n]
    EndIf
    permute_internal($arr[$n], $nRotateLevel - 1, $permutations)
    Next
    EndFunc ;==>permute_internal

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

    Func permute($sString)
    Global $permutations = ""
    permute_internal($sString, StringLen($sString), $permutations)
    $permutations = StringTrimLeft($permutations, 1)
    Return StringSplit($permutations, ":")
    EndFunc ;==>permute

    [/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™