7h331337 Posted June 16, 2008 Posted June 16, 2008 (edited) this just takes a screen shot and sends it over port 80 at your ip so you can watch whats on your comp i dont no if this was dun before but i was board and this is wat hapend CODE #include <ScreenCapture.au3> Global $session = 2 Global $listen Global $sock TCPStartup() HotKeySet('{ESC}', 'OnAutoItExit') Global $IP = @IPAddress2 if $ip = "0.0.0.0" Then $ip = @IPAddress1 endif If @error Then Exit Global Const $PORT = 80 Global $recv, $output $listen = TCPListen($IP, $PORT, 100) If $listen = -1 Then mError('Unable to connect.') Exit EndIf $refresh = 10 Run(@ComSpec & ' /c start http://' & $IP & ':' & $PORT, @ScriptDir, @SW_HIDE) $filepath = "c:\pic.jpg" While 1 $h = _ScreenCapture_Capture("") _ScreenCapture_SaveImage($filepath, $h) Sleep(40) $sock = TCPAccept($listen) $msg = GUIGetMsg() If $sock >= 0 Then $recv = _SockRecv($sock) If StringInStr($recv, "GET") Then $recv = _StringBetween($recv, "GET /", " HTTP/1.1") ConsoleWrite($recv) If $recv <> "" Then $file = FileOpen($filepath, 0) If $file <> -1 Then $output = FileRead($file) EndIf FileClose($file) Else $output = '<html><meta http-equiv="refresh" content="' & $refresh & '"><center><img src="scrshot.bmp"/><BR>Time Stamp ' & @HOUR & ':' & @MIN & ':' & @SEC & '<BR></center></html>' EndIf $send = _SockSend($sock, $output) TCPCloseSocket($sock) EndIf Sleep(1) WEnd Func mError($sText, $iFatal = 0, $sTitle = 'Error', $iOpt = 0) Local $ret = MsgBox(48 + 4096 + 262144 + $iOpt, $sTitle, $sText) If $iFatal Then Exit Return $ret EndFunc ;==>mError Func _SockRecv($iSocket, $iBytes = 2048) Local $sData = '' While $sData = '' $sData = TCPRecv($iSocket, $iBytes) WEnd Return $sData EndFunc ;==>_SockRecv Func _SockSend($iSocket, $sData) Return TCPSend($iSocket, $sData) EndFunc ;==>_SockSend Func OnAutoItExit() TCPCloseSocket($sock) TCPCloseSocket($listen) TCPShutdown() Exit EndFunc ;==>OnAutoItExit ;==>_StringBetween ;------------------------------------------------- Func _StringBetween($string, $begin, $end) Local $_begin, $_end $_begin = StringSplit($string, $begin, 1) If Not @error Then $_end = StringSplit($_begin[2], $end, 1) If Not @error Then Return ($_end[1]) EndIf EndIf EndFunc ;==>_StringBetween Edited June 17, 2008 by 7h331337
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now