Beiträge von K4z
-
-
-
-
du kannst es ja mal mit StringFormat probieren:
[autoit]_SQLite_Query(-1, StringFormat("SELECT DateiName, DateiGroesse FROM DateiDaten Where DiskNummer = '' AND Dateigroesse = (SELECT MAX(Dateigroesse) FROM DateiDaten WHERE Dateigroesse < %i)", $DiskFrei), $hQuery)
[/autoit] -
Vielleicht noch eine kleine Anregung, wie man das mit ner Whileschleife abfragen könnte, man muss allerdings dann seine Variablen geschickt benennen...
Ach und ich würd aus den RadioButtons bei Sonsitges Checkboxen machen, da beides gleichzeitig zutreffen kann.Spoiler anzeigen
[autoit]#include <GUIConstantsEx.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <WindowsConstants.au3>
#region GUI
$hGui = GUICreate("MsgBox-Generator", 366, 507, 373, 20)
GUICtrlCreateLabel("Icon:", 16, 152, 28, 17)
GUICtrlCreateLabel("Standard Button:", 224, 16, 84, 17)
GUICtrlCreateLabel("Sonstiges:", 224, 88, 53, 17)
GUICtrlCreateLabel("Modalität:", 224, 184, 50, 17)
GUICtrlCreateLabel("Ausgabe:", 16, 448, 49, 17)
GUICtrlCreateLabel("_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _", 16, 352, 340, 17)
GUICtrlCreateLabel("Titel:", 16, 256, 27, 17)
GUICtrlCreateLabel("Text:", 16, 304, 28, 17)GUICtrlCreateGroup("", -99, -99, 1, 1)
[/autoit] [autoit][/autoit] [autoit]
$hRadio0= GUICtrlCreateRadio("OK", 16, 32, 33, 17)
$hRadio1 = GUICtrlCreateRadio("OK und Abbrechen", 16, 48, 113, 17)
$hRadio2 = GUICtrlCreateRadio("Abbrechen, Wiederholen, Ignorieren", 16, 64, 193, 17)
$hRadio3 = GUICtrlCreateRadio("Ja, Nein, Abbrechen", 16, 80, 121, 17)
$hRadio4 = GUICtrlCreateRadio("Ja und Nein", 16, 96, 81, 17)
$hRadio5 = GUICtrlCreateRadio("Wiederholen und Abbrechen", 16, 112, 161, 17)
$hRadio6 = GUICtrlCreateRadio("Abbrechen, Wiederholen, Weiter", 16, 128, 177, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$hRadio7 = GUICtrlCreateRadio("Erster Button", 224, 32, 81, 17)
$hRadio8 = GUICtrlCreateRadio("Zweiter Button", 224, 48, 89, 17)
$hRadio9 = GUICtrlCreateRadio("Dritter Button", 224, 64, 81, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$hRadio10 = GUICtrlCreateRadio("Kein Icon", 16, 168, 65, 17)
$hRadio11 = GUICtrlCreateRadio("Stopp-Zeichen", 16, 184, 89, 17)
$hRadio12 = GUICtrlCreateRadio("Fragezeichen", 16, 200, 89, 17)
$hRadio13 = GUICtrlCreateRadio("Ausrufezeichen", 16, 216, 97, 17)
$hRadio14 = GUICtrlCreateRadio("Information", 16, 232, 73, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$hRadio15 = GUICtrlCreateRadio("Anwendung", 224, 200, 81, 17)
$hRadio16 = GUICtrlCreateRadio("System-modal", 224, 216, 89, 17)
$hRadio17 = GUICtrlCreateRadio("Task-modal", 224, 232, 81, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$hRadio18 = GUICtrlCreateCheckbox("immer im Vordergrund", 224, 104, 121, 17)
$hRadio19 = GUICtrlCreateCheckbox("Text rechtsbündig", 224, 120, 105, 17)
$hRadio20 = GUICtrlCreateLabel("Buttons:", 16, 16, 43, 17)$hInptOut = GUICtrlCreateInput("", 16, 472, 329, 21)
[/autoit] [autoit][/autoit] [autoit]
$hInptTitle = GUICtrlCreateInput("Überschrift", 16, 280, 329, 21)
$hInptText = GUICtrlCreateInput("Ich bin eine Msgbox!", 16, 328, 329, 21)
$hCheckTest = GUICtrlCreateCheckbox("Testen?", 280, 440, 65, 17)
$hBtnGo = GUICtrlCreateButton("MsgBox Generieren", 16, 384, 331, 41, $WS_GROUP)
GUICtrlSetState($hRadio0,$GUI_CHECKED)
GUICtrlSetState($hRadio7,$GUI_CHECKED)
GUICtrlSetState($hRadio10,$GUI_CHECKED)
GUICtrlSetState($hRadio15,$GUI_CHECKED)
GUICtrlSetState($hCheckTest,$GUI_CHECKED)
GUISetState(@SW_SHOW)
#endregion GUIWhile 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $hBtnGo
generate()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEndfunc generate()
[/autoit] [autoit][/autoit] [autoit]
Local $sResult, $flag = 0, $titel = GUICtrlRead($hInptTitle), $text = GUICtrlRead($hInptText)
Dim $aFlags[20]=[0,1,2,3,4,5,6,0,256,512,0,16,32,48,64,0,4096,8192,262144,524288]For $iI=0 To 19 Step 1
[/autoit] [autoit][/autoit] [autoit]
If GUICtrlRead(Eval("hRadio" & $iI)) = 1 Then
$flag += $aFlags[$iI]
EndIf
Next$sResult = StringFormat('MsgBox(%i, "%s", "%s")', $flag, $titel, $text)
[/autoit]
GUICtrlSetData($hInptOut,$sResult)
If GUICtrlRead($hCheckTest) = 1 Then Execute($sResult)
EndFunc -
Nein kann man nich:D Wenn ein case zutrifft, dann ist das eine Abbruchbedingung für die Selectschleife, dadurch würde dann zum Beispiel das selectieren von nem Icon vom Script gar nicht realisiert werden...
-
mit select():
[autoit]Select
[/autoit]
Case GUICtrlRead($btn1) = 1
$flag += 1
Case GUICtrlRead($btn2) = 1
$flag += 2
Case GUICtrlRead($btn3) = 1
$flag += 3
Case GUICtrlRead($btn4) = 1
$flag += 4
Case GUICtrlRead($btn5) = 1
$flag += 5
Case GUICtrlRead($btn6) = 1
$flag += 6
EndSelect
Select
Case GUICtrlRead($ic1) = 1
$flag += 16
Case GUICtrlRead($ic2) = 1
$flag += 32
Case GUICtrlRead($ic3) = 1
$flag += 48
Case GUICtrlRead($ic4) = 1
$flag += 64
EndSelect
Select
Case GUICtrlRead($mod1) = 1
$flag += 4096
Case GUICtrlRead($mod2) = 1
$flag += 8192
EndSelect
Select
Case GUICtrlRead($std1) = 1
$flag += 256
Case GUICtrlRead($std2) = 1
$flag += 512
EndSelect
Select
Case GUICtrlRead($son1) = 1
$flag += 262144
Case GUICtrlRead($son2) = 1
$flag += 524288
EndSelectaber obs so wirklich übersichtlicher wird ist fraglich.... ich hätts jetzt sowieso lieber mit comboboxen gemacht...
-
Da war doch tatsächlich jemand so sozial en plugin zu schreiben, das mit der EndpointVolume API kommuniziert:D
http://www.autoitscript.com/forum/topic/84…-master-volume/_SetMasterVolumeScalar_Vista() klappt bei mir perfekt, ich glaubs nich
[autoit]
Es würd dann z.B so aussehn(vista_vol.dll im selben Ordner):#AutoIt3Wrapper_Plugin_Funcs=_SetMasterVolumeScalar_Vista
[/autoit][autoit][/autoit][autoit]$hDLL = PluginOpen("vista_vol.dll")
[/autoit][autoit][/autoit][autoit]; ## Set new volume levels
[/autoit][autoit][/autoit][autoit]
_SetMasterVolumeScalar_Vista(32)PluginClose($hDLL)
[/autoit] -
Also zum Problem mit der Systemlautstärke:
[autoit]
Ich hatte vor einiger Zeit auch mal vor die Gesamtlautstärke einzustellen. Leider gehen die ganzen UDFs die ich dazu gefunden hab nicht bei win7 und ich hatte auch keine Lust jetzt nen aufwendigen dllcall oder Objects zu machen. Ich habs dann letztendlich einfach mit Send-Befehlen gelöst, da ich es jetzt auch nicht 100% genau einstellen wollte:Opt("SendKeyDelay", 0)
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]
Opt("SendKeyDownDelay", 0)_SetMainVol(32)
[/autoit][autoit][/autoit][autoit]Func _SetMainVol($iVol)
[/autoit][autoit][/autoit][autoit]
Send("{VOLUME_up 50}")If $iVol = 100 Then
[/autoit][autoit][/autoit][autoit]
Return
ElseIf $iVol<45 Then
$iPike = 50
Else
$iPike = 49
EndIfSend("{VOLUME_DOWN "& Int($iPike-(($iVol/100)*48)) & "}")
[/autoit]
EndFunc
Das ist zwar ziemlich "hässlich", aber ich kann meine Lautstärke so immerhin mit ner Ungenauigkeit von 1% einstellen...
Ein weiterer nachteil ist, dass die Funktion knapp 1 Sekunde benötigt...Ich hoff jemand hat eine bessere Lösung, denn daran wär ich auch schwerstens interressiert:D:D
-
Vielleicht liegts ja am Charset... Aber da _InetMail() das Standard-EmailProgramm benützt um Emails zu versenden, hab ich mal das Script so umgeändert, dass es ohne Email-Programm Emails verschickt und zusätzlich das Charset ISO 8859-1 benützt....
[autoit]
Musst halt die Daten von deinem Email Acc eintragen.
Du kannst es ja einfach mal probieren, ob sich was tut:D#include <INet.au3>
[/autoit][autoit][/autoit][autoit]
#include <Array.au3>
#include <GUIConstantsEx.au3>$s_SmtpServer = "" ;http://www.hoffmann-software.de/FrEewARE/Liste…SMTP-Server.htm
[/autoit][autoit][/autoit][autoit][/autoit][autoit]
$s_FromName = ""
$s_FromAddress = ""
$s_UName = ""
$s_PWD = ""Global $section, $combodata
[/autoit][autoit][/autoit][autoit]
$section = IniReadSection("Email.ini", "Emails")
Dim $Checkbox[$section[0][0] + 1]
_ArraySort($section, 0, 0, 0, 0)$Form1 = GUICreate("e-mail Programm", 400, Round($section[0][0] / 2) * 20 + 290)
[/autoit][autoit][/autoit][autoit][/autoit][autoit]
For $i = 1 To $section[0][0]
$Checkbox[$i] = GUICtrlCreateCheckbox($section[$i][0], 205 - Mod($i, 2) * 200, 5 + (Round($i / 2) - 1) * 20, 190, 25)
Next
$label1 = GUICtrlCreateLabel("_________________________________________________________________", 5, (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20 + 4, 390, 25)
$label2 = GUICtrlCreateLabel("Betreff:", 5, 18 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 390, 25)
GUICtrlSetColor(-1, 0x1B79D9)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Input1 = GUICtrlCreateInput(IniRead("Email.ini", "Standards", "Betreff", ""), 5, 35 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 390, 25)
GUICtrlSetBkColor(-1, 0xFFFFE1)
$label2 = GUICtrlCreateLabel("Nachrichttext:", 5, 78 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 390, 25)
GUICtrlSetColor(-1, 0x1B79D9)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Edit1 = GUICtrlCreateEdit(StringReplace(IniRead("Email.ini", "Standards", "Nachricht", ""), " |@CRLF| ", @CRLF), 5, 95 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 390, 100)
GUICtrlSetBkColor(-1, 0xFFFFE1)
$label3 = GUICtrlCreateLabel("Empfänger:", 5, 213 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 390, 25)
GUICtrlSetColor(-1, 0x1B79D9)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Input2 = GUICtrlCreateInput("", 5, 230 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 390, 25)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$Button1 = GUICtrlCreateButton("Standards speichern", 5, 260 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 150, 25)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Button3 = GUICtrlCreateButton("ini öffnen", 170, 260 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 90, 25)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Button2 = GUICtrlCreateButton("Email senden", 275, 260 + (Mod($section[0][0], 2) + Round($i / 2) - 1) * 20, 120, 25)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xC0DCC0)
GUISetState(@SW_SHOW)While 1
[/autoit][autoit][/autoit][autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Checkbox[1] To $Checkbox[$section[0][0]]
$emails = ""
For $i = 1 To $section[0][0]
If BitAND(GUICtrlRead($Checkbox[$i]), $GUI_CHECKED) Then
$emails &= $section[$i][1] & "; "
EndIf
Next
GUICtrlSetData($Input2, $emails)
Case $Button1
IniWrite("Email.ini", "Standards", "Betreff", GUICtrlRead($Input1))
IniWrite("Email.ini", "Standards", "Nachricht", StringReplace(GUICtrlRead($Edit1), @CRLF, " |@CRLF| "))
Case $Button2
Dim $as_Body[1]
$as_Body[0] = GUICtrlRead($Edit1) & @CRLF$as_ToAddress = StringSplit(GUICtrlRead($Input2), ";")
[/autoit][autoit][/autoit][autoit]
If StringStripWS($as_ToAddress[$as_ToAddress[0]],
= "" Then
_ArrayPop($as_ToAddress)
$as_ToAddress[0] -= 1
EndIfFor $i_i = 1 To $as_ToAddress[0]
[/autoit][autoit][/autoit][autoit]
_INetSmtpMailAuth($s_SmtpServer, $s_FromName, $s_FromAddress, $as_ToAddress[$i_i], $s_UName, $s_PWD, GUICtrlRead($Input1), $as_Body)
If @error Then
MsgBox(0, "Error!", "Mail failed with error code " & @error)
ExitLoop
Else
MsgBox(0, "Success!", "Mail sent")
EndIf
Next
;_INetMail(GUICtrlRead($Input2), GUICtrlRead($Input1), GUICtrlRead($Edit1) & @CRLF)Case $Button3
[/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]
ShellExecute(@ScriptDir & "\Email.ini")
EndSwitch
WEnd;===============================================================================
[/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
[/autoit][autoit][/autoit][autoit]
Local $s_IPAddress
Local $i_Count
Local $s_Send[9]
Local $s_ReplyCode[9];Return code from SMTP server indicating successIf $s_SmtpServer = "" Or $s_FromAddress = "" Or $s_ToAddress = "" Or $s_Username = "" Or $s_Passwd = "" Or $s_FromName = "" Or StringLen($s_FromName) > 256 Then
[/autoit][autoit][/autoit][autoit]
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
[/autoit][autoit][/autoit][autoit]
$s_ReplyCode[0] = "250"$s_Send[1] = "AUTH LOGIN" & @CRLF
[/autoit][autoit][/autoit][autoit]
$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 & _
[/autoit][autoit][/autoit][autoit]
"To: " & "<" & $s_ToAddress & ">" & @CRLF & _
"Subject: " & $s_Subject & @CRLF & _
"Mime-Version: 1.0" & @CRLF & _
"Content-Type: text/plain; charset=ISO 8859-1" & @CRLF & _ ;<---------------------CHARSET-------------------
@CRLF
$s_ReplyCode[7] = ""$s_Send[8] = @CRLF & "." & @CRLF
[/autoit][autoit][/autoit][autoit]
$s_ReplyCode[8] = "250"; open stmp session
[/autoit][autoit][/autoit][autoit]
If __SmtpSend($v_Socket, $s_Send[0], $s_ReplyCode[0], $b_trace, "220", $s_first) Then
SetError(50)
Return 0
EndIf; send header
[/autoit][autoit][/autoit][autoit]
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 ..)
[/autoit][autoit][/autoit][autoit]
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
[/autoit][autoit][/autoit][autoit]
SetError(500 + $i_Count)
Return 0
EndIf
Next; close the smtp session
[/autoit][autoit][/autoit][autoit]
$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
EndIfTCPCloseSocket($v_Socket)
[/autoit][autoit][/autoit][autoit][/autoit][autoit]
TCPShutdown()
Return 1
EndFunc ;==>_INetSmtpMailAuth;===============================================================================
[/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)$strUmsetzung = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
[/autoit][autoit][/autoit][autoit]
$strRetValue = ""For $i = 1 To StringLen($String) Step 3
[/autoit][autoit][/autoit][autoit]
$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 &= $strTokCrytCase 2
[/autoit][autoit][/autoit][autoit]
$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 & "="Case 1
[/autoit][autoit][/autoit][autoit]
$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 & "=="EndSwitch
[/autoit][autoit][/autoit][autoit]
NextReturn $strRetValue
[/autoit]
EndFunc ;==>_Base64Encoding -
oh habs falsch gelesen.. aber hat sich ja geklärt
-
Sodele hab da mal was ausgegraben, dass ich vor langer Zeit mal gemacht hab und bissle verändert.
[autoit]
Du kannst dabei sogar mehrere Einträge aufeinmal verschieben:#Include <GuiListBox.au3>
[/autoit][autoit][/autoit][autoit][/autoit][autoit]GUICreate("", 576, 438, 409, 292)
[/autoit][autoit][/autoit][autoit][/autoit][autoit]
$hListLeft = GUICtrlCreateList("", 16, 8, 217, 409, $LBS_EXTENDEDSEL)
$hListRight = GUICtrlCreateList("", 337, 10, 217, 409, $LBS_EXTENDEDSEL)
$hBtnToRight = GUICtrlCreateButton("-->", 248, 168, 75, 25)
$hBtnToLeft = GUICtrlCreateButton("<--", 248, 200, 75, 25)
GUISetState(@SW_SHOW); // ListItems generieren
[/autoit][autoit][/autoit][autoit][/autoit][autoit]
_GUICtrlListBox_BeginUpdate($hListLeft)
For $iI = 1 To 9
_GUICtrlListBox_AddString($hListLeft, StringFormat("hListLeft item: %i", $iI))
Next
_GUICtrlListBox_EndUpdate($hListLeft)
_GUICtrlListBox_BeginUpdate($hListRight)
For $iI = 1 To 9
_GUICtrlListBox_AddString($hListRight, StringFormat("hListLeft item: %i", $iI))
Next
_GUICtrlListBox_EndUpdate($hListRight)While 1
[/autoit][autoit][/autoit][autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $hBtnToRight
_TransferItems($hListLeft, $hListRight)
Case $hBtnToLeft
_TransferItems($hListRight, $hListLeft)
EndSwitch
WEndFunc _TransferItems($hList1, $hList2)
[/autoit][autoit][/autoit][autoit]
$aSelectedItems = _GUICtrlListBox_GetSelItems($hList1)For $iI = $aSelectedItems[0] To 1 Step -1
[/autoit]
_GUICtrlListBox_AddString($hList2, _GUICtrlListBox_GetText($hList1, $aSelectedItems[$iI]))
_GUICtrlListBox_DeleteString($hList1, $aSelectedItems[$iI])
Next
EndFunc -
_FileReadToArray() prüft schon selber ob die Datei überhaupt existiert, wenn sie nich existiert, dann setzt es @Error auf 1...
[autoit]_FileReadToArray(@ScriptDir & "\Titel der Folgen.txt", $namen)
[/autoit]
If @error = 1 Then
MsgBox(0, "Error", "Datei existiert nicht.")
ElseIf @error = 2 Then
MsgBox(0, "Error", "Fehler beim Einlesen der Datei")
EndIf
Also zumindest ich empfinde das als bessere Lösung...
Aber jeder hat seinen eigenen StilAlso ich denke Error handling ist wirklich ein wichtiges Thema, schau dir mal den Thread von Andy an.
Du erleichterst dir das Programmieren einfach ungemein.
Sei nicht böse, ich will dir nur helfen
-
@sillyboy vlt en paar tipps:
- Autoit-Quellcode tag benützen
- FileOpen() ist in dem Fall unnötig... Wenn dann würd ich halt wenigstens dann das handle in _FileReadToArray() weiterverwenden:D
- wenn man fileopen benützt, sollte man die Datei mit FileClose() wieder schließen -
also ich könnt mir denken, dass _FileReadToArray en Error zurück gibt:
[autoit]_FileReadToArray("Titel der Folgen.txt.", $namen)
[/autoit]
Versuchs mal ohne den Punkt hinter txt:D -
Schau dir mal W P E pro an
-
Edit: bisschen verkürzt...
[autoit]
[/autoit][autoit][/autoit][autoit]
;;;;;;;;;;;;
;; Server ;;
;;;;;;;;;;;;
OnAutoItExitRegister("_exit")
UDPStartup()Global Const $g_IP = @IPAddress1
[/autoit][autoit][/autoit][autoit]$aServerSocket = UDPBind($g_IP, 65432) ;gibt ein Array zurück: [1] real socket, [2] local IP, [3] Port
[/autoit][autoit][/autoit][autoit]
If @error <> 0 Then Exit
While 1
$aData = UDPRecv($aServerSocket, 50, 2) ;gibt ein Array zurück: [0] data, [1] from IP, [2] from Port
If $aData <> "" Then
Local $aClientArray[4] = [$aServerSocket[0], $aServerSocket[1], $aData[1], $aData[2]]MsgBox(0, "UDP DATA Server", $aData[0])
[/autoit][autoit][/autoit][autoit]UDPSend($aClientArray, 'Server->Client')
[/autoit][autoit][/autoit][autoit]EndIf
[/autoit][autoit][/autoit][autoit]
Sleep(100)
WEndFunc _exit()
[/autoit]
UDPShutdown()
EndFunc -
wenn du nicht gerade tonnen an daten verschicken möchtest, würd ich sowieso empfehlen lieber tcp zu nehmen.
nur meine meinung...EDIT: http://www.noshacks.de/anleitungen-tu…s-t1115/p1.html
könnte ganz interessant seinEDIT2: Hast du sicher die UDP library gestartet?
-
So einfach geht das glaube ich nicht, aber hier sind ein paar Workarounds:
http://www.autoitscript.com/forum/topic/63…lor-of-a-group/mfg K4z
-
Heyho,
schau mal in der Hilfe unter _GDIPlus_BitmapCreateFromHBITMAP nach.
Das Beispiel macht exakt das, was du willst:D