Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 03:19

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Abgleich

Discussion on Abgleich within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
Juloko's Avatar
 
elite*gold: 1
Join Date: Feb 2010
Posts: 270
Received Thanks: 911
Abgleich

Hallo Community,

ich sitze gerade vor einem kleinem Problem.
Ich habe ein Skript gebaut, mit dem man 2 Programme öffnen und schließen kann (ganz über Benutzeroberfläche).
Dazu wird in eine Datei geschrieben welche Programme gerade laufen (*.txt Datei)
Die sieht wiefolgt aus:

Quote:
0
0

;Es läuft keine der beiden *.exe Dateien, wenn bei beiden eine 1 angezeigt wird, laufen beide.
So, derzeit wird jede Sekunde überprüft, ob beide Programm laufen, und die Datei wird sofort aktualisiert.
Ich möchte die *.txt Datei jetzt aber auf einen FTP-Server Laden um im Internet abfragen zu können, ob beide Programme laufen oder aus sind.

Der Dateiupload ist soweit funktionsfähig, ich möchte nur nicht jede Sekunde die Datei erneut hochladen.
Wie kann ich überprüfen, ob die Datei bzw. die Zustände geändert wurden?

Ich höffe ihr könnt mir helfen, Grüße
Juloko is offline  
Old 09/18/2011, 22:27   #2
 
BlackHybrid's Avatar
 
elite*gold: 52
The Black Market: 101/0/0
Join Date: Oct 2010
Posts: 1,998
Received Thanks: 389
Wie wäre es mit einer Abfrage, ob der Wert in der Datei = der Wert, den du ermittelst ist. Wenn das nicht der Fall ist lädst du es hoch.
BlackHybrid is offline  
Thanks
1 User
Old 09/18/2011, 22:29   #3
 
omer36's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,254
if FileReadLine() = 1 then ... ?
omer36 is offline  
Thanks
1 User
Old 09/19/2011, 14:40   #4
 
Juloko's Avatar
 
elite*gold: 1
Join Date: Feb 2010
Posts: 270
Received Thanks: 911
Hey, danke für die schnellen Antworten.

Es ist glaube ich nicht ganz so gut für's Logische denken wenn man zu viel Code auf einmal Schreibt

Ich hab das ganze so gelöst indem ich, wenn ein Programm An,- oder Ausgeschaltet wird eine Variable auf "1" setze. Diese wird jede Sekunde abgefragt, und sobald sie auf "1" steht tritt ein Ereignis ein und sie wird wieder auf "0" gesetzt.

Grüße und ein #cr
Juloko is offline  
Old 09/19/2011, 22:33   #5
 
| Moep |'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,079
Received Thanks: 438
ermittle einfach den hash der datei. Ist bei jeder Datei unterschiedlich, sobald auch nur ein Zeichen anderst ist. Hier ein Beispiel dazu aus der Autoit Hilfe.

Code:
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <Crypt.au3>

; Example of hashing files

; Create GUI
$hWnd=GUICreate("Hasher",370,60)
$hFileControl=GUICtrlCreateInput("",5,5,200,20)
$hBrowseButton=GUICtrlCreateButton("...",210,5,35,20)
$hHashCombo=GUICtrlCreateCombo("MD5",250,5,50,20)
GUICtrlSetData(-1,"MD2|MD4|SHA1")
$hCalcButton=GUICtrlCreateButton("Calculate",305,5,60,20)
$hHashLabel=GUICtrlCreateLabel("Hash Digest",5,35,365,20,$SS_CENTER)

GUISetState(@SW_SHOW)

_Crypt_Startup()

Do
	$msg=GUIGetMsg()

	Switch $msg
		Case $hBrowseButton
			$sFile=FileOpenDialog("Open file","","All files (*.*;)")
			GUICtrlSetData($hFileControl,$sFile)

		Case $hCalcButton
			$iALG_ID=0
			; What algorthm did the user choose?
			Switch GUICtrlread($hHashCombo)
				Case "MD2"
					$iALG_ID=$CALG_MD2
				Case "MD4"
					$iALG_ID=$CALG_MD4
				Case "MD5"
					$iALG_ID=$CALG_MD5
				Case "SHA1"
					$iALG_ID=$CALG_SHA1
				Case Else
					MsgBox(16,"Error","Not a valid algorithm!")
					ContinueLoop
			EndSwitch
			$sFile=GUICtrlRead($hFileControl)
			If Not FileExists($sFile) Then
				MsgBox(16,"Error","Invalid file")
				ContinueLoop
			EndIf
			$bDigest=_Crypt_HashFile($sFile,$iALG_ID)
			GUICtrlSetData($hHashLabel,$bDigest)

		Case $GUI_EVENT_CLOSE
			ExitLoop

	EndSwitch
Until False

_Crypt_Shutdown()
| Moep | is offline  
Reply


Similar Threads Similar Threads
Hs Metin2client.bin root abgleich für offi metin2 De
02/02/2011 - Metin2 - 8 Replies
offi update 2.12 root enpacken wegen attribute AP HI leute ich hab mal ne frage ich weis net ob ich hier richtig binn hoffe den wenn ich als was frage bekomme immer ne verwahrnung also wie ihr wisst hat des offi Metin2 ein aupdate bekommen am 02,12 jetzt ist meine frage die root lässt sich nicht mehr komplett enpacken da sich das datei attribut von A auf AP geändert hast Das "P"-Attribut gibt an, dass eine Datei eine ist Analysepunkt . Die Anwendung dieses Attribut erstellt die Datei...



All times are GMT +2. The time now is 03:19.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.