Sign in to follow this  
Followers 0
Phodexis

INetGet Error

4 posts in this topic

i trying to write like radmin program :D

my client always screen cap to in my webserver <screen.jpg> 1sec. 4-5 pic.

this is my viewer code.

but this script sometimes crash. i need to fix it. anybody help it ?

Sorry, My English can sometimes be insufficient

#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <Inet.au3>
#include <Misc.au3>
#include <Constants.au3>
#include <GDIPlus.au3>
Opt("TrayIconHide",1)
Opt("GUIOnEventMode", 1)


If @Compiled Then
Global $izlenen=$CmdLine[1]
Else
$izlenen="192.168.0.40"
EndIf
$first = TRUE ; Gui Creating
$nPORT = 80

$begin=TimerInit()
Dim $Picizle,$Formizle

$ScreenshotName = @ScriptDir & "\" & $izlenen & ".jpg"

While 1
Sleep(50)
FileDelete($ScreenshotName)
Local $return = InetGet ("http://" & $izlenen & ":5485/screen.jpg?" & TimerDiff($begin), $ScreenshotName,1)
            While InetGetInfo($return, 2)
;ConsoleWrite("1")
            WEnd
            ; <...>
InetClose($return)

if NOT @error then
;if $return <> 0 Then GUICtrlSetImage($Picizle, $ScreenshotName)


if $first Then
    _GDIPlus_Startup ()
    $hImage = _GDIPlus_ImageLoadFromFile($ScreenshotName)
    $width = _GDIPlus_ImageGetWidth($hImage)
    $height = _GDIPlus_ImageGetHeight($hImage)
    ;GUICtrlSetPos ($Formizle, 0, 0, $width, $height)
    _GDIPlus_ImageDispose ($hImage)
    _GDIPlus_ShutDown ()
    $first=FALSE
    Form()
EndIf
if FileExists($ScreenshotName) Then GUICtrlSetImage($Picizle, $ScreenshotName)
endif
$return=""
WEnd


Func Form()
$Formizle = GUICreate("[" & $izlenen & "] Ekran İzleme", $width, $height, 10, 10, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS))
GUISetOnEvent($GUI_EVENT_CLOSE, "formizlekapat")
$Picizle = GUICtrlCreatePic($ScreenshotName, 0, 0, $width, $height, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUICtrlSetOnEvent(-1, "boyut")
GUISetState(@SW_SHOW,$Formizle)
#EndRegion ### END Koda GUI section ###
GUICtrlSetResizing($Picizle, $GUI_DOCKAUTO+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM)
EndFunc

Func boyut()
;GUICtrlSetPos ($Formizle, 0, 0, 800, 600)
;GUISetCoord(20, 60, 800, 600,$Formizle)
if FileExists($ScreenshotName) Then GUICtrlSetImage($Picizle, $ScreenshotName)
EndFunc

Func formizlekapat()
GUIDelete($Formizle)
exit
EndFunc

Share this post


Link to post
Share on other sites



ERROR: InetGetInfo(): undefined function.

ERROR: InetClose(): undefined function.


_____________________________________________________________________________

Share this post


Link to post
Share on other sites

you can delete this codes, not necessery for run

While InetGetInfo($return, 2)
;ConsoleWrite("1")
            WEnd
            ; <...>
InetClose($return)

Share this post


Link to post
Share on other sites

ERROR: InetGetInfo(): undefined function.

ERROR: InetClose(): undefined function.

Use the current AutoIt-Stable, your version is outdated.

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
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
Sign in to follow this  
Followers 0