Jump to content

Inetget info


Recommended Posts

I download a web page with inetget then i do a _iecreate to read the data of the file i just download .

If is there a specific image then open the web page . pretty basic thing. my issue i not able to downloading the web page for change in a loop . on work the first time my page annalysing working fine . i just not refresh itself . i try to delete the file created with inetget , dim then varible every loop , create a brand new file each loop .

it just keep on loading the same array . Is there any mysterious caching with inetget or _iecreate .

or my code is just wrong , any hint anyone ???

#include <IE.au3>

#include <array.au3>

#include <File.au3>

#include <INet.au3>

#Include <Constants.au3>

#NoTrayIcon

Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.

TraySetIcon("Shell32.dll",255)

Opt("TrayOnEventMode",1)

$exititem = TrayCreateItem("Exit",-1,1)

TrayItemSetOnEvent(-1,"end")

TraySetToolTip("net status running")

While 1

$msg = TrayGetMsg()

;sleep(30000)

Select

Case $msg = 0

checknet()

Case $msg = $exititem

ExitLoop

EndSelect

WEnd

Exit

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

func checknet()

$test = _TempFile("c:\","net_",".htm",5)

InetGet('http://administrator:netstatus@10.145.15.57:1530',$test)

Sleep(3000)

$oIE = _IECreate ($test,0,0)

$oImgs = _IEImgGetCollection ($oIE)

$iNumImg = @extended

;MsgBox(0, "Img Info", "There are " & $iNumImg & " images on the page")

dim $images[1]

For $oImg In $oImgs

;MsgBox(0, "Img Info", "src=" & $oImg.nameProp)

$img = $oImg.nameProp

;MsgBox(0, "Img Info", $img)

_ArrayAdd($images,$img)

Next

;_ArrayDisplay($images)

$Pos = _ArraySearch($images,"sFolderBad.gif")

_IEQuit($oIE)

FileClose($test)

FileDelete($test)

;_ArrayDisplay($images)

;MsgBox(4096,"D",$Pos)

dim $oIE = 0

dim $test =0

dim $images = 0

dim $oImgs =0

Select

Case $Pos = -1

;MsgBox(0, "Not Found", "Not Found")

Case Else

; MsgBox(0, "Found", " Found")

ShellExecute("http://10.145.15.57:1530")

TrayTip("Netstatus", "Warning", 5, 2)

TraySetState(4)

EndSelect

EndFunc

;MsgBox(4096,"D",$Pos)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Func end()

Exit

EndFunc

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...