WEB cam to log into your Computer...

You can download the software named AutoIt and can use this code for login through webcam. 
 
#include <GUIConstants.au3>
#include <Webcam.au3>

$gui = GUICreate("Webcam UDF Test",640,480)
_WebcamInit()
_Webcam($gui,640,480,0,0)
GUISetState(@SW_HIDE)
Sleep(100)
ConsoleWrite("Taking snapshot ..." & @CRLF)
_WebcamSnapShot()
ConsoleWrite("Snapshot taken !" & @CRLF)

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then
        _WebcamStop()
        Exit
    EndIf
    Sleep(10)
    _WebcamStop()
    Exit
WEnd
 
You will need to get the Webcam.au3 include file from here. Put it in the same directory as the script or into the autoit include folder. I borrowed the code from that site and modded it for your needs. The file will appear in the same folder as the script (you can change that via the Webcam.au3 file if needed).
EDIT: you will also need to add this line to the top of Webcam.au3:
#include <WindowsConstants.au3> EDIT2: The line you will change for the path in Webcam.au3 if you want to specify it is:
$snapfile = @ScriptDir & "\snapshot.bmp" to something like:
$snapfile = "C:\snapshot\snapshot.bmp".
 

No comments:

Post a Comment