Jump to content

Remote Monitoring - to print the screen every second


kater
 Share

Recommended Posts

Hi Guy's :)

.. Remote Monitoring ..

My Idea is Remote Monitoring as the following

  • we need to create code by Auto it to print the existing screen every second and save it in C Drive with name TEST
  • we need to create a new web site and let this site automatic updating to get the last screen " this is very esay "

with this idea we can create remote monitoring for any user and we can use it with

IT team

I have some code's I'll put it here but after your feedback about this idea " your feedback is very important for me "

Guy's ;) we need your assisting to success this idea .

Link to comment
Share on other sites

There are several reasons why this is generally not a great idea once put into practice:

The extra activity in writing a file every second

The amount of bandwidth exceeded in refreshing the page containing the image

If images are kept for a period of time, the amount of space used by them

The fact that an AutoIT script is a high level language would mean consuming more CPU time on this task than is generally required.

If you wish to create your application anyway, There are example scripts on saving a Screen shot to a File using AutoIT. And providing you enable IIS 6.0 in Windows XP you can save the file directly to the same place each time, always over-writing the previous image. And perhaps a basic web page with Javascript running to constantly refresh the image?

In my opinion, Your best option is to use VNC, It will provide you with the ability to View any system on your network in REAL TIME, and if you so wish, to interact with that system to offer Technical Support.

Which version you choose to use is your choice.

There are several available:

My personal preference:

http://www.tightvnc.com/

Also:

http://www.uvnc.com/

http://www.realvnc.com/

http://www.cl.cam.ac.uk/research/dtg/attar...vnc/winvnc.html

Alternatively, there are several commercial programs available which offer extra features:

GoverLan - http://www.pjtec.com/Products/index_static.htm

I hope this post contained some useful information for you.

Regards

/tAK

Edited by tAKTelapis
Link to comment
Share on other sites

OK Guy's :)

let's to complete our task

This is my code to get snapshot for the screen and save it in this directory C:\Remote

#include <IE.au3>
Hotkeyset("{F1}","OpenSite")
while 1
sleep(100)
wend
Func OpenSite()

SEND("{PRINTSCREEN}")
Run("mspaint.exe")
WinWaitActive("untitled - Paint")
WinSetState ( "untitled - Paint", "", @SW_MAXIMIZE )
Send("!EP")
Send("P")
WinWaitActive("untitled - Paint")
Send("!FA")
Send("!T")
Send("{DOWN}")
Send("{DOWN}")
Send("{ENTER}")
Send("!N")
$sFileName = @MON & @MDAY & @HOUR & @MIN & @SEC & ".jpg"

Send("C:\Remote\test.JPG")

Sleep(1000)
Send("{ENTER}")
Send("{TAB 1}")
Send("{ENTER}")
Sleep(1000)
Send("!{F4}")
Send("!{F4}")
EndFunc
Exit

and regarding the Web site I was created the site by FrontPage and I imported the directory of the image in the site

the code will take snapshot for the screen and will save the image of the screen in the mentioned directory and it will displaying on the site

and the snapshot ting will be every second

with this idea the updating of the screen will be every second

Please your feedback ;)

I'd like to change some thing in the existing code but after your feedback about this idea

:P

Edited by kater
Link to comment
Share on other sites

_ScreenCap_Capture("C:\Remote\test.JPG")

much easier

Sorry but explain to me exactly how to use the below code

#include <IE.au3>
Hotkeyset("{F1}","OpenSite")
while 1
sleep(100)
wend
Func OpenSite()

ScreenCap_Capture("C:\Remote\test.JPG")

EndFunc
Exit

I faced some errors , Pls help me

Edited by kater
Link to comment
Share on other sites

you have to download the au3lib, it is a function that is included it is call <A3LScreenCap.au3>

" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Link to comment
Share on other sites

#include <A3LScreenCap.au3>

HotKeySet("{Esc}", "Quit")
Call("StartCapture")

Func StartCapture()
Local $count = 0
    
    While 1
        Sleep(1000)
        _ScreenCap_Capture("C:\Remote\pic" & $count & ".JPG")
        $count += 1
    Wend
EndFunc

Func Quit ()
Exit
EndFunc

There you go, make sure you have Au3Lib tought... there's a link in that post. Press ESCAPE to stop the script. Pics are saved in C:\Remote

Link to comment
Share on other sites

Thank you > galpha :P

but I have idea :)

I do not like to create many images in the mentioned directory I want to create One image and replace it every second with same name

Please your kind advice is very important to me ;)

Link to comment
Share on other sites

Hi,

#NoTrayIcon

#include <Misc.au3>
If Not _Singleton("WebVNC Manadar") Then ;needs Misc.au3 first
    Exit
EndIf
#include <A3LScreencap.au3>

Dim $index = '<html>' & @CRLF & _
'<head>' & @CRLF & _
'<META http-equiv="refresh" content="1">' & @CRLF & _
'<title>Manadar''s WebVNC</title>' & @CRLF & _
'</head>' & @CRLF & _
'<body bgcolor="#303030">' & @CRLF & _
'<center>' & @CRLF & _
'<img src="scnshot.jpg">' & @CRLF & _
'</center>' & @CRLF & _
'</body>' & @CRLF & _
'</html>'

TCPStartup()

;Set up the variables
$MaxClient = 12

Dim $Socket[$MaxClient]
Dim $Buffer[$MaxClient]

For $x = 0 to UBound($Socket)-1 ; fills the socket array with -1 for error checking
    $Socket[$x] = -1
Next

Dim $IP = @IPAddress1
Dim $Port = 80 ; the listening port

TCPStartup()

$MainSocket = TCPListen($IP,$Port) ;create main listening socket
If @error Then
    MsgBox(0, "", "Can't listen") ; can't create socket, error out.
    Exit
EndIf

ShellExecute("http://" & $IP & "/")

While 1
    ; accepting incoming connections
    $NewSocket = TCPAccept($MainSocket)
    If $NewSocket >= 0 Then
        For $x = 0 to UBound($Socket)-1
            If $Socket[$x] = -1 Then
                $Socket[$x] = $NewSocket ;store the new socket
                ExitLoop
            EndIf
        Next
    EndIf
    For $x = 0 to UBound($Socket)-1 ;receiving loop
        If $Socket[$x] <> -1 Then
            $NewData = TCPRecv($Socket[$x],1024)
            If @error Then
                $Socket[$x] = -1
            ElseIf $NewData Then ; data received
                $Buffer[$x] &= $NewData ;store it in the buffer
                If StringInStr(StringStripCR($Buffer[$x]),@LF&@LF) Then
                    $FirstLine = StringLeft($Buffer[$x],StringInStr($Buffer[$x],@LF))
                    $RequestType = StringLeft($FirstLine,StringInStr($FirstLine," ")-1)
                    If $RequestType = "GET" Then
                        $Request = StringTrimRight(StringTrimLeft($FirstLine,4),11)
                        If $Request = "/" Then
                            $Packet = SendHTML($index)
                        Else
                            If StringRight($Request,3) = "jpg" OR StringRight($Request,3) = "bmp" Then
                                $JPEG = StringTrimLeft($Request,1)
                                IF $JPEG = "scnshot.jpg" Then
                                    _ScreenCap_Capture(@ScriptDir & "\scnshot.jpg")
                                    $Delete = 1
                                Else
                                    $Delete = 0
                                EndIf
                                $File = FileOpen($JPEG,16)
                                $JPEGBuffer = FileRead($File)
                                FileClose($File)
                                If $Delete = 1 Then FileDelete($JPEG)
                                
                                $Packet = Binary("HTTP/1.1 200 OK" & @CRLF & _ 
                                "Server: ManadarX/1.3.26 (" & @OSVersion & ") AutoIt " & @AutoItVersion & @CRLF & _
                                "Connection: close" & @CRLF & _
                                "Content-Type: image/jpeg" & @CRLF & _
                                @CRLF)
                                TCPSend($Socket[$x],$Packet)
                                
                                While BinaryLen($JPEGbuffer) ;Larry's idea to send in chunks
                                    $a = TCPSend($Socket[$x],$JPEGbuffer)
                                    $JPEGbuffer = BinaryMid($JPEGbuffer,$a+1,BinaryLen($JPEGbuffer)-$a)
                                WEnd
                                
                                $Packet = Binary(@CRLF & _
                                @CRLF)
                                TCPSend($Socket[$x],$Packet)
                            Else
                                $Packet = SendHTML("404 error: Bad request or data not found.")
                            EndIf
                        EndIf
                        TCPSend($Socket[$x],$Packet)
                    EndIf
                    $Buffer[$x] = ""
                    TCPCloseSocket($Socket[$x])
                    $Socket[$x] = -1
                EndIf
            EndIf
        EndIf
    Next
WEnd

Func SendHTML($HTML)
    $Packet = Binary("HTTP/1.1 200 OK" & @CRLF & _ 
    "Server: ManadarX/1.3.26 (" & @OSVersion & ") AutoIt " & @AutoItVersion & @CRLF & _
    "Connection: close" & @CRLF & _
    "Content-Type: text/html" & @CRLF & _
    @CRLF & _
    $HTML & _
    @LF & _
    @LF)
    TCPSend($Socket[$x],$Packet)
EndFunc
Link to comment
Share on other sites

Sorry Mr.Manadar :) is difficult code and too long !

we need to change some thing in that code that created by Mr. galpha it's very simple just we need to modify it to get the screen every second and save the screen in one image every second with the same name in this directory c:\Remote

Link to comment
Share on other sites

I'm going to put this as nice as I can. You are rude. People are helping you, and you are acting like a ring leader and we are your servants. To be honest, what you are asking to do only serves one purpose - to record what someone is doing. What you do with the information afterwords is where lies a huge problem. Stealing information like passwords, account numbers, and so forth comes to mind. Frankly, I'm surprised you have gotten this much help. Do us all a favor. Stop asking for help. Do it yourself. Manadar is a respected coder and someone who I like very much, and you basically treated him like dirt.

we need to change some thing in that code that created by Mr. galpha it's very simple just we need to modify it to get the screen every second and save the screen in one image every second with the same name in this directory c:\Remote

Do it yourself. We are not your servants.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...