@ka1477: Lass uns dann bitte doch hier weiter diskutieren und entferne bitte deine Frage aus dem anderen Thread.
Die Spezifikation der Kommunikation von PowerOff.exe ist folgende:
Code:
5 Remote Control
You can remotely control poweroff by starting it as a service and setting the ‘Allow remote control’ option. You can control it by using poweroff itself and selecting a remote computer, or you can control it by using telnet to the port where poweroff listens on (default 3210). For example telnet computer 3210. You’ll see a welcome message like this:
201 Welcome to Poweroff 3.0 created by Jorgen Bosman
Poweroff uses a protocol like ftp or smtp with commands and reply codes. You enter a command and poweroff will reply with ‘2xx message’ on success or ‘5xx message’ on error.
You can enter the following commands:
QUIT Terminates the connection
HELP Shows this help
PASSWORD p Authenticates the client with a password
ACTION a The action to perform (logoff, reboot, shutdown, poweroff, standby, hibernate, lock, wol, monitor_off, monitor_on, no_action)
WHO w Who must perform the action (local, remote)
WHEN w When must the action be performed (immediate, scheduled, after_process)
SIMULATE s Simulate the action (on, off)
COMPUTER c The remote computer name
MAC m The remote computer mac address (WOL)
IP i The remote computer ip address (WOL)
SUBNET s The remote computer subnet mask (WOL)
WARNING w Show warning before doing the action (on, off)
WARNTIME w The number of seconds to show the warning
MESSAGE m The warning message
PLAYSOUND p Play a sound when showing the warning (on, off)
SOUNDFILE s The WAV file to play
RUNPRG r Runs a program before doing the action (on, off)
PROGRAM p The program to run
DIRECTORY d The startup directory for the program
SCHEDULE s The type of schedule (fixed_day, daily, day_of_month, after_x_seconds)
TIME t The time when to do the action (hh:mm)
DATE d The date when to do the action (dd/mm/yyyy)
DAYS d The days of the week when to do the action (m, t, w, th, f, s, su)
WEEKS d The weeks of the month when to do the action (1, 2, 3, 4, 5)
DAY d The day of the month when to do the action (1-31)
WAIT w The number of seconds to wait before checking the time
SECONDS w The number of seconds to wait before doing the action
PROCESS p Wait for process p to finish
FORCE f Force applications to close (on, off)
CANCEL c Allow the user to cancel the action (on, off)
SHOW Show current settings
VERSION Show current poweroff version
DOIT Do the action
STOP Stops the current scheduled action
Example:
telnet computer 3210
201 Welcome to Poweroff 3.0.0.5 created by Jorgen Bosman
action logoff
250 OK
warning on
250 OK
message You will be logged off in 10 seconds
250 OK
warntime 10
250 OK
doit
250 OK
quit
201 Bye bye
Connection closed by foreign host.
Dies ist übrigens auf der Seite zu poweroff.exe ausführlich dokumentiert.
Du musst nicht alles von diesem Protokoll implementieren, es wäre aber meiner Meinung nach sinnvoll sich an diesem Standard zu halten. Der Autor hatte sich schon darüber einige Gedanken gemacht. Und diese Ideen finde ich gar nicht verkehrt. Es ähnelt sich zwar sehr an die Kommunikation mit einem SMTP- oder FTP-Server. Aber ganz verkehrt ist die Idee dadurch nicht.
Wenn du deine Kenne in Windows-Programmierung dafür einsetzen könntest, etwas noch schlankeres als poweroff.exe zu entwickeln, wäre es ganz gut. Beachte aber bitte, dass wir diese Windows-Implementierung hier eigentlich nicht diskutieren wollen, denn es geht hier eigentlich um FREETZ. Deswegen bitte (wenn überhaupt) nur eine fertige Lösung von deinem Programm posten. Wenn es durch dein Programm mehr Interesse und Anerkennung hier findet, könnte ich es auf FREETZ-Seite etwas weiter treiben.
MfG