Beiträge von i2c
-
-
Wird das hier ein Rekordversuch in Doppelpostings?
Man kann Beiträge bearbeiten. -
[autoit]
FileWrite($IniFile,"")
[/autoit] -
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <array.au3>
#include <File.au3>
Dim $aResult[1][2]
$sFile = @ScriptDir & "\test.txt"For $i = 2 To _FileCountLines($sFile)
[/autoit] [autoit][/autoit] [autoit]
$sLine = FileReadLine($sFile, $i)
ConsoleWrite($sLine & @CRLF)
If StringInStr($sLine, "PC010", 1) And StringInStr($sLine, "Aktiv", 1) Then
$aTmp = StringSplit($sLine, ";", 1)
If IsArray($aTmp) And $aTmp[0] = 30 Then
$iIndex = _ArraySearch($aResult, $aTmp[4], 0, 0, 1, 0, 1, 0)
If $iIndex = -1 Then
_Array2DAdd($aResult, $aTmp[4] & "|1")
ElseIf $iIndex >= 0 Then
$aResult[$iIndex][1] += 1
EndIf
EndIf
EndIf
Next_ArrayDisplay($aResult)
[/autoit] [autoit][/autoit] [autoit];------------------------------------------------------------------------------------------------------------
[/autoit]
;
; Function _Array2DAdd(ByRef $avArray, $sValue='')
;
; Description Redim Array Size and add an Array element at last position
; Works with any occurences in 2nd Dimension
; Works also with 1D-Array
;
; Parameter $avArray Given Array
; optional $sValue Value of new Element, parts must be seperate with '|'
;
; Return Succes -1
; Failure 0 and set @error
; @error = 1 given array is not array
; @error = 2 given parts of Element too less/much
;
; Author BugFix ([email='bugfix@autoit.de'][/email])
;------------------------------------------------------------------------------------------------------------
Func _Array2DAdd(ByRef $avArray, $sValue = '')
If (Not IsArray($avArray)) Then
SetError(1)
Return 0
EndIf
Local $i
Local $UBound2nd = UBound($avArray, 2)
If @error = 2 Then
ReDim $avArray[UBound($avArray) + 1]
$avArray[UBound($avArray) - 1] = $sValue
Else
Local $arValue
ReDim $avArray[UBound($avArray) + 1][$UBound2nd]
If $sValue = '' Then
For $i = 0 To $UBound2nd - 2
$sValue &= '|'
Next
EndIf
$arValue = StringSplit($sValue, '|')
If $arValue[0] <> $UBound2nd Then
SetError(2)
Return 0
EndIf
For $i = 0 To $UBound2nd - 1
$avArray[UBound($avArray) - 1][$i] = $arValue[$i + 1]
Next
EndIf
Return -1
EndFunc ;==>_Array2DAdd -
Versteh ich nicht wirklich.
[autoit]$f = 1.8
[/autoit]
ConsoleWrite(Floor($f) & @CRLF)
ConsoleWrite(Floor($f)+1 & @CRLF) -
Nein, es gibt nur ganze Pixel.
-
Ok, jetzt hab ich's verstanden. In einer Art Administrationspanel sollen Daten festgelegt werden die dann von den (AutoIt)Clients verarbeitet werden.
Möglichkeit 1: Das Adminpanel legt die Daten in einer Textdatei ab. Bei mehreren Datensätzen vlt. sogar im INI Format. Die Clients holen sich die Daten dann per InetRead().
Möglichkeit 2: Das Adminpanel legt die Datensätze in einer Datenbank ab. Ein 2tes PHP-Skript wird von den Clients angesprochen und holt die notwendigen Daten wieder aus der Datenbank und stellt sie zur Verfügung. Bei mehreren Datensätzen kann man hierbei durch Parameter die Ausgabe steuern.Eine direkte Verbindung der Clients zum MySQL-Server würde ich vermeiden. Sicherheit ... und so.
-
Ich bin verwirrt. Das dort oben ist kein PHP Quellcode sondern HTML.
Wohin soll das führen? So wie du es beschreibst, ruft jemand deine Seite auf, trifft eine Auswahl bei den radios und dein AutoIt Skript liest dann aus, was gewählt wurde. Sehr ... komisch. Zumal dein Skript ja nie den Seiteninhalt des Benutzers zu sehen bekommt.
Zum Thema MySQL und AutoIt: https://autoit.de/index.php?page…ight=mysql+ohne
-
Spoiler anzeigen
[autoit]#include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <WinAPI.au3>_ImageResize(@DesktopDir & "\Chrysanthemum.jpg", @DesktopDir & "\Chrysanthemum_resized.jpg", @DesktopWidth, @DesktopHeight)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]; #FUNCTION# =========================================================================================
[/autoit] [autoit][/autoit] [autoit]
; Name...........: _ImageResize
; Description....: Resize an image and optionally convert it to the format you want.
; Syntax.........: _ImageResize($sInImage, $sOutImage, $iW, $iH)
; Parameters ....: $sInImage - Full path to the image to resize / convert.
; In types: *.bmp, *.gif, *.ico, *.jpg, *.jpeg, *.png, *.tif, *.tiff
; $sOutImage - Full path where to save the resized / converted image.
; Out types: *.bmp, *.gif, *.jpg, *.jpeg, *.png, *.tif, *.tiff
; $iW - Width to resize image to.
; $iH - Height to resize image to.
; Return values .: Success - Return 1 and @error 0
; Failure - Return 0 and @error 1~5
; @error 1 = In File does not exist
; @error 2 = In File format not supported
; @error 3 = Out File path does not exist
; @error 4 = Out file format not supported
; @error 5 = Resize Width or Height not an integer
; Author ........: smashly
; ====================================================================================================
Func _ImageResize($sInImage, $sOutImage, $iW, $iH)
Local $sOP, $sOF, $sInExt, $Ext, $hBitmap, $hImage1, $hImage2, $hGraphic, $CLSID, $i = 0
Local $sType = "BMP|GIF|ICO|JPG|JPEG|PNG|TIF|TIFF"If Not FileExists($sInImage) Then Return SetError(1, 0, 0)
[/autoit] [autoit][/autoit] [autoit]
$sInExt = StringUpper(StringTrimLeft($sInImage, StringInStr($sInImage, ".", 0, -1)))
If Not StringRegExp($sInExt, "\A(" & $sType & ")\z", 0) Then Return SetError(2, 0, 0);OutFile path, to use later on.
[/autoit] [autoit][/autoit] [autoit]
$sOP = StringLeft($sOutImage, StringInStr($sOutImage, "\", 0, -1))
If Not FileExists($sOP) Then Return SetError(3, 0, 0);OutFile name, to use later on.
[/autoit] [autoit][/autoit] [autoit]
$sOF = StringTrimLeft($sOutImage, StringInStr($sOutImage, "\", 0, -1));OutFile extension , to use for the encoder later on.
[/autoit] [autoit][/autoit] [autoit]
$Ext = StringUpper(StringTrimLeft($sOutImage, StringInStr($sOutImage, ".", 0, -1)))
If Not StringRegExp($Ext, "\A(" & $sType & ")\z", 0) Or $Ext = "ICO" Then Return SetError(4, 0, 0)If Not IsInt($iW) And Not IsInt($iH) Then Return SetError(5, 0, 0)
[/autoit] [autoit][/autoit] [autoit]; WinAPI to create blank bitmap at the width and height to put your resized image on.
[/autoit] [autoit][/autoit] [autoit]
$hBitmap = _WinAPI_CreateBitmap($iW, $iH, 1, 32);Start GDIPlus
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_Startup();Get the handle of blank bitmap you created above as an image
[/autoit] [autoit][/autoit] [autoit]
$hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap);Load the image you want to resize.
[/autoit] [autoit][/autoit] [autoit]
$hImage2 = _GDIPlus_ImageLoadFromFile($sInImage);Get the graphic context of the blank bitmap
[/autoit] [autoit][/autoit] [autoit]
$hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage1);Draw the loaded image onto the blank bitmap at the size you want
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage2, 0, 0, $iW, $iH);Get the encoder of to save the resized image in the format you want.
[/autoit] [autoit][/autoit] [autoit]
$CLSID = _GDIPlus_EncodersGetCLSID($Ext);Generate a number for out file that doesn't already exist, so you don't overwrite an existing image.
[/autoit] [autoit][/autoit] [autoit]
Do
$i += 1
Until (Not FileExists($sOP & $i & "_" & $sOF));Prefix the number to the begining of the output filename
[/autoit] [autoit][/autoit] [autoit]
$sOutImage = $sOP & $i & "_" & $sOF;Save the new resized image.
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_ImageSaveToFileEx($hImage1, $sOutImage, $CLSID);Clean up and shutdown GDIPlus.
[/autoit]
_GDIPlus_ImageDispose($hImage1)
_GDIPlus_ImageDispose($hImage2)
_GDIPlus_GraphicsDispose($hGraphic)
_WinAPI_DeleteObject($hBitmap)
_GDIPlus_Shutdown()
Return SetError(0, 0, 1)
EndFunc ;==>_ImageResize -
-
Externer Inhalt www.youtube.comInhalte von externen Seiten werden ohne deine Zustimmung nicht automatisch geladen und angezeigt.Durch die Aktivierung der externen Inhalte erklärst du dich damit einverstanden, dass personenbezogene Daten an Drittplattformen übermittelt werden. Mehr Informationen dazu haben wir in unserer Datenschutzerklärung zur Verfügung gestellt.
und alles Gute funkey!
-
Spoiler anzeigen
[autoit]#include <array.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)
#region - GUI Create
GUICreate('', 100, 100)
$button1 = GUICtrlCreateButton("1", 8,
GUICtrlSetOnEvent(-1, "_run")
$button2 = GUICtrlCreateButton("2", 8, 40)
GUICtrlSetOnEvent(-1, "_run")
GUISetState()
#endregion - GUI Create#region - GUI SelectLoop
[/autoit] [autoit][/autoit] [autoit]
While 1
Sleep(100)
WEnd
#endregion - GUI SelectLoopFunc _run()
[/autoit] [autoit][/autoit] [autoit]
Switch @GUI_CtrlId
Case $button1
_button(1)
Case $button2
_button(2)
_button2(2)
EndSwitch
EndFunc ;==>_runFunc _button($param)
[/autoit] [autoit][/autoit] [autoit]
MsgBox(0, 0, "_button(): ausgelöst von Button " & $param)
EndFunc ;==>_buttonFunc _button2($param)
[/autoit]
MsgBox(0, 0, "_button2(): ausgelöst von Button " & $param)
EndFunc ;==>_button2 -
"ungetestet"
[autoit]#include <ButtonConstants.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=g:\projekte\tataria\main.kxf
$Form2 = GUICreate("Form2", 915, 456, 193, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form2Close")
$Label1 = GUICtrlCreateLabel("IMEI:", 28, 32, 29, 17)
$Input1 = GUICtrlCreateInput("", 65, 29, 121, 21, BitOR($ES_AUTOHSCROLL,$ES_NUMBER))
GUICtrlSetLimit(-1, 15)
$Label2 = GUICtrlCreateLabel("Modell: ", 18, 63, 41, 17)
$Input2 = GUICtrlCreateInput("", 66, 60, 121, 21)
$Label3 = GUICtrlCreateLabel("Name:", 21, 93, 35, 17)
$Input3 = GUICtrlCreateInput("", 66, 90, 121, 21)
$Button1 = GUICtrlCreateButton("Suchen", 54, 375, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###While 1
[/autoit] [autoit][/autoit] [autoit]
Sleep(100) ;Schleife
WEndFunc Button1Click() ;Auf Suchen gedrückt
[/autoit] [autoit][/autoit] [autoit]$IMEI = GUICtrlRead($Input1)
[/autoit] [autoit][/autoit] [autoit]
$Modell = GUICtrlRead($Input2)
$Name = GUICtrlRead($Input3)If $IMEI <> "" Then;Funktioniert einwandfrei!!!
[/autoit] [autoit][/autoit] [autoit]
$SearchIMEI = IniReadSection("test.txt",$IMEI)
GUICtrlSetData($Input2,$SearchIMEI[1][1])
GUICtrlSetData($Input3,$SearchIMEI[2][1])
ElseIf $Modell <> "" Then;Funktioniert NICHT!
$SearchModell = IniReadSection("test.txt",$Modell)
GUICtrlSetData($Input1,$SearchModell[1][1])
GUICtrlSetData($Input3,$SearchModell[2][1])
EndIfEndFunc
[/autoit]
Func Form2Close()
Exit
EndFunc -
Spoiler anzeigen
[autoit]#include <GUIConstants.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <ComboConstants.au3>
#include <GuiComboBoxEx.au3>
#region - GUI Create
GUICreate('', 200, 100)
$Combo1 = GUICtrlCreateCombo("bla", 8, 8, 100, Default, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1, "blub|blubber")
$Button = GUICtrlCreateButton("klick", 8, 35)
GUISetState()
#endregion - GUI Create#region - GUI SelectLoop
[/autoit]
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $Button
$index = _GUICtrlComboBoxEx_GetCurSel(GUICtrlGetHandle($Combo1))
MsgBox(0, 0, $index)
EndSelect
WEnd
#endregion - GUI SelectLoop -
Und die Fehlermeldungen lauten?
Möglicherweise erlaubt 1&1 den Datenbankzugriff nur über localhost, also nicht von aussen.
-
-
Schau dir mal das Hilfebeispiel zu GUICtrlRead() an.
Ein Button wäre dann auch ganz praktisch. -
-
[autoit]
Ping()
[/autoit] -
Vlt. lässt sich auch SendMessageTimeout benutzen (fuFlag = SMTO_ABORTIFHUNG)