Jump to content

Search the Community

Showing results for tags 'internet'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 25 results

  1. IE Embedded Control Versioning Use IE 9+ and HTML5 features inside a GUI This UDF allows the use of embedded IE controls which support IE versions greater than IE 7. By default, all embedded IE controls default to IE 7 compatibility mode (unless for some reason somebody has IE 6 installed!), so its not possible to use most of the HTML5 features available today. Fortunately, IE 9 and greater allow the use of HTML5, and the embedded IE control actually supports it. The problem is convincing Windows to let your program actually use those features! There are Registry branches that modify how an IE control works in specific programs. Those branches are: HKCU\Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION HKLM\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION In at least one of these branches, the executable name needs to appear as a value name ("autoit.exe" for example), and the value data needs to indicate what IE version to 'emulate'. The value data is actually dependent on the version and whether quirks-mode is enabled. See Web Browser Control - Specifying the IE Version for more information. Note that a 64-bit O/S needs adjustments to the HKLM paths. Also, prefer the HKCU branch unless the program needs to enable access across all user accounts. HTML5 Canvas Element Example Anyway, all the complexity of setting the right value with the right name with the right 32/64-bit branch is handled for you in this UDF. Enabling support for IE9+, and new HTML5 features, is as simple as making one call to _IE_EmbeddedSetBrowserEmulation(). _IE_EmbeddedSetBrowserEmulation() takes an executable name (@AutoItExe if none is provided), and checks the Registry for an entry for it. If it doesn't find one, it will create one and enable support for later versions of IE. The full parameters to the function are as follows: _IE_EmbeddedSetBrowserEmulation($nIEVersion, $bIgnoreDOCTYPE = True, $bHKLMBranch = False, $sExeName = @AutoItExe) The parameter passed in $nIEVersion can be anything from 8 to 11 [or 12+ in the future], or just the current version of IE, which is available also through a call to _IE_EmbeddedGetVersion(). $bIgnoreDOCTYPE controls when IE will go into quirks mode based on any "<!DOCTYPE>" declarations on webpages. This mode can cause major problems, so by default it is set to ignore it (set this to False to enable it). $bHKLMBranch controls where in the registry the Browser Emulation Mode setting will be stored. If you wish to store the mode for ALL users, set this parameter to True. Note, however, that elevated privileges are required for modifying the HKLM branch! If the call to _IE_EmbeddedSetBrowserEmulation() is successful, then you can enable a (more) HTML5 compliant IE browser control in a GUI. The complete set of functions in the UDF: _IE_EmbeddedGetVersion() ; Gets version of IE Embeddable Control (from ieframe.dll or Registry) _IE_EmbeddedGetBrowserEmulation() ; Gets Browser Emulation Version for given Executable (or 0 if not found) _IE_EmbeddedSetBrowserEmulation() ; Sets Browser Emulation Version. NOTE: HKLM branch REQUIRES ELEVATED PRIVILEGES! _ IMPORTANT: Setting the embedded browser object to a newer version of IE may alter the behavior of some things. See documenation for the HTMLDocumentEvents2 interface and HTMLAnchorEvents2 interface for example. Also, there is at least one difference in behavior noted by mesale0077 in working with IE10 (and possibly other versions of IE) - clicks for elements inside an <a> anchor tag will register as the actual internal element rather than the surrounding anchor. For example, an <img> element wrapped by an <a> anchor will only send the click to the <img> element and not propagate it any further. A workaround for this is to check the parentNode to see if it is an <a> element. See the discussion in the >ObjEvent dont work thread. It could be that there's some other reason for this behavior, but nothing has come to light yet. As an aside, also see trancexx's response in >ObjEvent usage for more techniques for capturing IE events. History: An example of HTML5 use, which has a little interactive Canvas, follows (requires IE9 or higher!): #include "IE_EmbeddedVersioning.au3" ; =============================================================================================================================== ; <IE_EmbeddedHTML5Example.au3> ; ; Example of using 'IE_EmbeddedVersioning' UDF ; ; This example 1st attempts to set the Browser Emulation information in the registry, then ; creates an embedded IE control with an interactive HTML5 Canvas element. ; ; Author: Ascend4nt ; =============================================================================================================================== #Region IE_CANVAS_EXAMPLE #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> ; ----------- ; GLOBALS ; ----------- Global $bMouseDown = False, $iLastX1 = 0, $iLastY1 = 0 Global $g_oCanvas, $g_oCtx Global $hGUI, $ctGUI_ErrMessageLabel Global $GUI_IE_Obj Global $nRet = _WinMain() ; Optionally remove valuename at Exit (not recommended if compiled to executable) ;~ _IE_EmbeddedRemoveBrowserEmulation() Exit $nRet ; ====================================================================================================== ; Embedded IE Browser-Emulation Fix + HTML5 Example ; ====================================================================================================== Func _WinMain() ConsoleWrite("@AutoItX64 = " & @AutoItX64 & ", IsAdmin() = " & IsAdmin() & @CRLF) ;; Get Current IE Embeddable Control Version (from ieframe.dll) Local $sIEVer = _IE_EmbeddedGetVersion(), $nIEVer = @extended ConsoleWrite("Embedded Version = " & $sIEVer & ", as Int: " & $nIEVer & ", @error = " & @error & @CRLF) ; Old IE version w/o HTML5 support? Exit If $nIEVer < 9 Then Return MsgBox(0, "Old IE Version", "IE version is less than 9, HTML5 example will not work") ;; Current Browser Emulation Mode for this executable (if exists) Local $nIEBEVer = _IE_EmbeddedGetBrowserEmulation() ConsoleWrite("GetEmbeddedVersion: " & $nIEBEVer & ", @error = " & @error & ", @extended = " & @extended & @CRLF) ;; Set Browser Emulation Mode for this executable (if not already set or set to a different version) ; HKCU Branch: _IE_EmbeddedSetBrowserEmulation() ; HKLM Branch: ;_IE_EmbeddedSetBrowserEmulation(-1, True, True) If @error Then ; -1 error means trying to access HKLM, so script needs elevation to access the Registry If @error = -1 Then If MsgBox(32 + 3, "Elevation Required", "Elevate script to enable setting Browser Emulation Mode?") = 6 Then Return _ReRunIfNotElevated() Return 1 EndIf Return MsgBox(0, "Error", "Couldn't set Browser Emulation mode") EndIf ;Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") ;; Create Embedded Browser Control and GUI Local $oIE = _IECreateEmbedded() ; GUI (vars are Global) $hGUI = GUICreate("Embedded Web control Test", 460, 360, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) $GUI_IE_Obj = GUICtrlCreateObj($oIE, 10, 10, 440, 340) $ctGUI_ErrMessageLabel = GUICtrlCreateLabel("", 100, 500, 500, 30) GUICtrlSetColor(-1, 0xff0000) GUISetState(@SW_SHOW) ;Show GUI ; Doesn't work (at least for keyboard focus): ;~ ControlFocus($hGUI, '', $GUI_IE_Obj) ;; Initialize Embedded Control and write some HTML5 data to it _IENavigate($oIE, 'about:blank' ) ; Basic Near-Empty HTML (with minimal CSS styling for Canvas element) Local $sHTML = '<!DOCTYPE html>' & @CR & '<html>' & @CR & '<head>' & @CR & _ '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR & _ '<title>Experiments</title>' & @CR & _ '<style>canvas { display:block; background-color:white; outline:#00FF00 dotted thin;}</style>' & @CR & _ '</head>' & @CR & '<body>' & @CR & '</body>' & @CR & '</html>' _IEDocWriteHTML($oIE, $sHTML) _IEAction($oIE, "refresh") ;; Setup Event Object Functions Local $oEventsDoc = ObjEvent($oIE.document, "Event_", "HTMLDocumentEvents2") #forceref $oEventsDoc ;~ ConsoleWrite("Obj Name = " & ObjName($oIE) & @CRLF) ;~ ConsoleWrite("Location = " & $oIE.document.location.pathname & @CRLF) ; -------------------------------------------------------------------------------------- ; Create Canvas Element through the DOM (optionally just add it in the HTML5 above) ; ------------------------------------------------- ; Note: Support in browsers, see "Can I use..." ; @ http://caniuse.com/#feat=canvas ; and @ http://caniuse.com/#search=canvas ; ------------------------------------------------- ; IE minimum is version 9+, 10+ has more features, but WebGL support requires version 11+ ; -------------------------------------------------------------------------------------- $g_oCanvas = $oIE.document.createElement("canvas") $g_oCanvas.id = "myCanvas" ;~ ConsoleWrite("Canvas ID = " & $g_oCanvas.id & @CRLF) $oIE.document.body.appendChild($g_oCanvas) ; Optionally, if added already through the HTML5 text: ;Local $g_oCanvas = _IEGetObjById($oIE, "myCanvas") If @error Then Return MsgBox(0, "Error", "Error creating/accessing Canvas") ;; Tweak Canvas Size, Move into View ;~ ConsoleWrite("window innerwidth = " & $oIE.document.parentWindow.innerWidth & @CRLF) ;$oIE.document.parentWindow.scrollTo(0, 10) $g_oCanvas.width = 420 $g_oCanvas.height = 320 ;ConsoleWrite("Canvas item offsetTop = " & $g_oCanvas.offsetTop & @CRLF) $g_oCanvas.scrollIntoView() ;; Grab the Canvas 2D Context $g_oCtx = $g_oCanvas.getContext("2d") ;; Example Drawing: Gradiant Local $oGrad = $g_oCtx.createLinearGradient(0,0,0,60) If IsObj($oGrad) Then $oGrad.addColorStop(0, "red") $oGrad.addColorStop(1, "blue") $g_oCtx.fillStyle = $oGrad EndIf $g_oCtx.fillRect(0,0,419,60) ;; Example Drawing: Text $g_oCtx.font = "30px serif" $g_oCtx.fillStyle = "white" $g_oCtx.textBaseline = "top" $g_oCtx.fillText("HTML5 Canvas Drawing!", 50, 10) ;; Example Drawing: Circle, Line $g_oCtx.beginPath() $g_oCtx.arc(200, 100, 20, 0, ACos(-1) * 2) $g_oCtx.fillStyle = "red" $g_oCtx.fill() $g_oCtx.beginPath() $g_oCtx.lineWidth = "3" $g_oCtx.strokeStyle = "green" $g_oCtx.moveTo(185, 85) $g_oCtx.lineTo(215, 115) $g_oCtx.stroke() ; Waiting for user to close the window While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd GUIDelete() EndFunc ; ====================================================================================================== ; IE Event Functions - React to Mouse events with some Canvas graphics ; ====================================================================================================== #Region IE_EVENT_FUNCS ; For right-click, the context menu pops up, UNLESS we change the Event's 'returnValue' property Volatile Func Event_oncontextmenu($oEvtObj) If IsObj($oEvtObj) Then ; Convert to string so that 0 doesn't match EVERY string Local $sId = $oEvtObj.srcElement.id & "" If ($sId = "myCanvas") Then $oEvtObj.returnValue = False EndIf EndFunc Volatile Func Event_onmousedown($oEvtObj) If IsObj($oEvtObj) And IsObj($g_oCtx) Then ; Map click coordinates to Canvas coordinates $iLastX1 = $oEvtObj.x - $g_oCanvas.offsetLeft $iLastY1 = $oEvtObj.y - $g_oCanvas.offsetTop ;~ ConsoleWrite("Downclick recvd at X1: " & $iLastX1 & ", Y1: " & $iLastY1 & ", MouseButton [1 = left, 2 = right, etc] = " & $oEvtObj.button & @CRLF) ; Check if click was in fact within Canvas element If $iLastX1 >= 0 And $iLastX1 < $g_oCanvas.width And $iLastY1 >= 0 And $iLastY1 < $g_oCanvas.height Then ; Signal mouse-down occurred inside Canvas $bMouseDown = 1 ; Make a small square where initial down-click was detected $g_oCtx.fillStyle = "blue" $g_oCtx.fillRect($iLastX1 - 2, $iLastY1 - 2, 3, 3) EndIf EndIf EndFunc Volatile Func Event_onmouseup($oEvtObj) If IsObj($oEvtObj) And IsObj($g_oCtx) Then ;~ ConsoleWrite("MouseUp" & @LF) If $bMouseDown Then Local $iX = $oEvtObj.x - $g_oCanvas.offsetLeft, $iY = $oEvtObj.y - $g_oCanvas.offsetTop ; Random color in "#0f1100" (RGB) string form Local $sColor = "#" & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) ;; Draw either a line or circle depending on where the mouse button is released If $iX = $iLastX1 And $iY = $iLastY1 Then ; Circle if mouse start = mouse end $g_oCtx.beginPath() $g_oCtx.arc($iX, $iY, 8, 0, ACos(-1) * 2) $g_oCtx.fillStyle = $sColor $g_oCtx.fill() Else ; Line if mouse start <> mouse end $g_oCtx.beginPath() $g_oCtx.lineWidth = "3" $g_oCtx.strokeStyle = $sColor $g_oCtx.moveTo($iLastX1, $iLastY1) $g_oCtx.lineTo($iX, $iY) $g_oCtx.stroke() EndIf $bMouseDown = 0 EndIf EndIf EndFunc Volatile Func Event_onkeydown($oEvtObj) If IsObj($oEvtObj) Then ConsoleWrite("Event type: " & $oEvtObj.type & "id (0 is document) = " & $oEvtObj.srcElement.id) ConsoleWrite(", keycode = " & $oEvtObj.keyCode & ", shiftkey = " & $oEvtObj.shiftKey & @CRLF) EndIf EndFunc ; ====================================================================================================== #EndRegion IE_EVENT_FUNCS #EndRegion IE_CANVAS_EXAMPLE #Region UTIL_FUNCS ; ====================================================================================================== ; Func _ReRunIfNotElevated() ; ; Does what it says. (rumored to occasionally say what it does) ; ; Author: Ascend4nt ; ====================================================================================================== Func _ReRunIfNotElevated() If IsAdmin() Then Return 0 Else If @Compiled Then ; If compiled to A3X, we need to execute it as if not compiled. Local $sCmd = (@AutoItExe = @ScriptFullPath) ? "" : ("/AutoIt3ExecuteScript " & @ScriptFullPath) Return ShellExecute(@AutoItExe, $sCmd, @ScriptDir, "runas") Else Return ShellExecute(@AutoItExe,@ScriptFullPath,@ScriptDir,"runas") EndIf EndIf EndFunc #EndRegion UTIL_FUNCS IEEmbeddedVersioning.zip ~prev Downloads: 61 Also, HTML5+Javascript standalone Canvas demo (should run in any browser): HTML5StandaloneCanvasDemo.zip
  2. Hi, for a script of mine, I wish to keep a time frame on till how the program will work.. basically, I want the program to read the date and if the read date < 'a particular date', the program continues, else it exit. I don't want to read the time from the computer as the program can be fooled by resetting the pc time. is there a way to read time from internet - so that the user cannot fool the program by date reset? thanks
  3. I have an aws cloud machine where I kept all the build process to create some set of zip files and uploading them to OneDrive. Once it is completed, I have another local machine in our environment which is a acting as a local share server also. Is there anyway to notify this machine(without public IP) to start downloading these files. I have written an AutoIT exe to download these files and copy them to respective locations.But don't know how to notify this from the remote machine. Any suggestion??
  4. Its Possible To auto Login with autoit script ?
  5. Good evening guys, i'm having a problem, not about the code (i'm only thinking about it at the moment) but about the way i can do it. I have a webpage (photo N.1) it has some elements in it. I need only the table (photo N.2), looking at the code and with _IEFunctions i can easy find the table but how i can i "copy" it? As i said it's really easy to found with a script but what should i do then? Copy the source? And how can i display it to the user? In my head i'd like to display it inside a GUI, is that possible? Thanks in advance Edit: Posted 2 times same photo. Now should be OK
  6. How can i add sleep command using internet speed. If my internet speed is 40-50Kbps then sleep for 5 seconds, If my internet speed is 30-40Kbps then sleep for 4 seconds, If my internet speed is 20-30Kbps then sleep for 3 seconds. *Sleep command used bitween my costom script, Example, RunWait("rasdial /disconnect", "", @SW_HIDE) ; Stop connect from start Sleep(5000) RunWait("rasdial Internet", "", @SW_HIDE) ; Connect again
  7. Please Somebody Help me i am trying to create new script but, i don't know how to create it. I am Creating script like this : ; My script here [First Script] Check the internet connection, if internet connected then ; My Script here [Second Script] If internet not connected, wait for connect, after connected run my second script If Control id/windows/title matched do nothing and end/exit autoit script If Control id/windows/title not matched repeat my first and second script again until control id/windows/tittle not matched match with : >>>> Window <<<< Title: PS :: Version - 2.8.0.0 - [PS Bill] Class: WindowsForm734a Position: -8, -8 Size: 1382, 744 Style: 0x17CD0000 ExStyle: 0x00050100 Handle: 0x0000000000130572 >>>> Control <<<< Class: WindowsForm734a Instance: 15 ClassnameNN: WindowsForm34a15 Name: BillPrint Advanced (Class): [NAME:BillPrint] ID: 7875 Text: Position: 39, 310 Size: 1221, 306 ControlClick Coords: 745, 20 Style: 0x56010000 ExStyle: 0x00000000 Handle: 0x00000000000C0468
  8. How can i stop/pause my internet connection for only 7 seconds, after 7 seconds automaticaly resume my internet. Please give me scripte
  9. i am trying to figure out how a server can connect to a client Over the internet. In this is script. The client connects to the server on the same machine (localhost) and executes the commands from the client. How can I change that instead communicating over localhost to communicate over the internet with tcp ipaddress and a port. What i actually need help of is 1. The server will open a port and listen to communication from a No-ip address 2. I input the no-ip address and correct port in the client side, and when i click on connect, it connects to the server if its online This is the client #include <GuiConstantsEx.au3> THIS IS THE CLIENT #include <NamedPipes.au3> #include <StaticConstants.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> ; =============================================================================================================================== ; Description ...: This is the client side of the pipe demo ; Author ........: Paul Campbell (PaulIA) ; Notes .........: ; =============================================================================================================================== ; =============================================================================================================================== ; Global constants ; =============================================================================================================================== Global Const $BUFSIZE = 4096 Global Const $DEFCMD = "cmd.exe /c dir c:\" Global Const $PIPE_NAME = "\\$\\pipe\\AutoIt3" Global Const $ERROR_MORE_DATA = 234 ; =============================================================================================================================== ; Global variables ; =============================================================================================================================== Global $g_idEdit, $g_idMemo, $g_idSend, $g_idServer, $g_hPipe ; =============================================================================================================================== ; Main ; =============================================================================================================================== CreateGUI() MsgLoop() ; =============================================================================================================================== ; Creates a GUI for the client ; =============================================================================================================================== Func CreateGUI() Local $hGUI = GUICreate("FarC0nn3c7", 500, 400, -1, -1, $WS_SIZEBOX) GUICtrlCreateLabel("Server:", 2, 14, 52, 20, $SS_RIGHT) $g_idServer = GUICtrlCreateEdit("<local>", 56, 10, 200, 20, $SS_LEFT) GUICtrlCreateLabel("Command:", 2, 36, 52, 20, $SS_RIGHT) $g_idEdit = GUICtrlCreateEdit($DEFCMD, 56, 32, 370, 20, $SS_LEFT) $g_idSend = GUICtrlCreateButton("Pawn Dem", 430, 32, 60, 20) $g_idMemo = GUICtrlCreateEdit("", 0, 62, _WinAPI_GetClientWidth($hGUI), 332) GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New") GUISetState() EndFunc ;==>CreateGUI ; =============================================================================================================================== ; Logs an error message to the display ; =============================================================================================================================== Func LogError($sMessage) $sMessage &= " (" & _WinAPI_GetLastErrorMessage() & ")" GUICtrlSetData($g_idMemo, GUICtrlRead($g_idMemo) & $sMessage & @CRLF) EndFunc ;==>LogError ; =============================================================================================================================== ; Logs a message to the display ; =============================================================================================================================== Func LogMsg($sMessage) GUICtrlSetData($g_idMemo, GUICtrlRead($g_idMemo) & $sMessage & @CRLF) EndFunc ;==>LogMsg ; =============================================================================================================================== ; MsgLoop ; =============================================================================================================================== Func MsgLoop() While True Switch GUIGetMsg() Case $g_idSend SendCmd() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc ;==>MsgLoop ; =============================================================================================================================== ; This function opens a pipe to the server ; =============================================================================================================================== Func OpenPipe() Local $sName, $sPipe ; Get pipe handle $sName = GUICtrlRead($g_idServer) If $sName = "<local>" Then $sName = "." $sPipe = StringReplace($PIPE_NAME, "$", $sName) $g_hPipe = _WinAPI_CreateFile($sPipe, 2, 6) If $g_hPipe <> -1 Then Return True LogError("OpenPipe failed") Return False EndFunc ;==>OpenPipe ; =============================================================================================================================== ; This function reads a message from the pipe ; =============================================================================================================================== Func ReadMsg() Local $bSuccess, $iRead, $pBuffer, $tBuffer $tBuffer = DllStructCreate("char Text[4096]") $pBuffer = DllStructGetPtr($tBuffer) GUICtrlSetData($g_idMemo, "") While 1 $bSuccess = _WinAPI_ReadFile($g_hPipe, $pBuffer, $BUFSIZE, $iRead, 0) If $iRead = 0 Then ExitLoop If Not $bSuccess Or (_WinAPI_GetLastError() = $ERROR_MORE_DATA) Then ExitLoop GUICtrlSetData($g_idMemo, StringLeft(DllStructGetData($tBuffer, "Text"), $iRead), 1) WEnd EndFunc ;==>ReadMsg ; =============================================================================================================================== ; This function sends a command to the server ; =============================================================================================================================== Func SendCmd() If OpenPipe() Then SetReadMode() WriteMsg(GUICtrlRead($g_idEdit)) ReadMsg() _WinAPI_CloseHandle($g_hPipe) EndIf EndFunc ;==>SendCmd ; =============================================================================================================================== ; This function sets the pipe read mode ; =============================================================================================================================== Func SetReadMode() If Not _NamedPipes_SetNamedPipeHandleState($g_hPipe, 1, 0, 0, 0) Then LogError("SetReadMode: _NamedPipes_SetNamedPipeHandleState failed") EndIf EndFunc ;==>SetReadMode ; =============================================================================================================================== ; This function writes a message to the pipe ; =============================================================================================================================== Func WriteMsg($sMessage) Local $iWritten, $iBuffer, $pBuffer, $tBuffer $iBuffer = StringLen($sMessage) + 1 $tBuffer = DllStructCreate("char Text[" & $iBuffer & "]") $pBuffer = DllStructGetPtr($tBuffer) DllStructSetData($tBuffer, "Text", $sMessage) If Not _WinAPI_WriteFile($g_hPipe, $pBuffer, $iBuffer, $iWritten, 0) Then LogError("WriteMsg: _WinAPI_WriteFile failed") EndIf EndFunc ;==>WriteMsg And this is the server #include <GuiConstantsEx.au3> #include <NamedPipes.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #NoTrayIcon ; =============================================================================================================================== ; Description ...: This is the server side of the pipe demo ; Author ........: Paul Campbell (PaulIA) ; Notes .........: ; =============================================================================================================================== ; =============================================================================================================================== ; Global constants ; =============================================================================================================================== Global Const $DEBUGGING = False Global Const $BUFSIZE = 4096 Global Const $PIPE_NAME = "\\.\\pipe\\AutoIt3" Global Const $TIMEOUT = 5000 Global Const $WAIT_TIMEOUT = 258 Global Const $ERROR_IO_PENDING = 997 Global Const $ERROR_PIPE_CONNECTED = 535 ; =============================================================================================================================== ; Global variables ; =============================================================================================================================== Global $g_hEvent, $g_idMemo, $g_pOverlap, $g_tOverlap, $g_hPipe, $g_hReadPipe, $g_iState, $g_iToWrite ; =============================================================================================================================== ; Main ; =============================================================================================================================== CreateGUI() InitPipe() MsgLoop() ; =============================================================================================================================== ; Creates a GUI for the server ; =============================================================================================================================== Func CreateGUI() Local $hGUI $hGUI = GUICreate("Pipe Server", 500, 400, -1, -1, $WS_SIZEBOX) $g_idMemo = GUICtrlCreateEdit("", 0, 0, _WinAPI_GetClientWidth($hGUI), _WinAPI_GetClientHeight($hGUI)) GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New") GUISetState() EndFunc ;==>CreateGUI ; =============================================================================================================================== ; This function creates an instance of a named pipe ; =============================================================================================================================== Func InitPipe() ; Create an event object for the instance $g_tOverlap = DllStructCreate($tagOVERLAPPED) $g_pOverlap = DllStructGetPtr($g_tOverlap) $g_hEvent = _WinAPI_CreateEvent() If $g_hEvent = 0 Then LogError("InitPipe ..........: API_CreateEvent failed") Return EndIf DllStructSetData($g_tOverlap, "hEvent", $g_hEvent) ; Create a named pipe $g_hPipe = _NamedPipes_CreateNamedPipe($PIPE_NAME, _ ; Pipe name 2, _ ; The pipe is bi-directional 2, _ ; Overlapped mode is enabled 0, _ ; No security ACL flags 1, _ ; Data is written to the pipe as a stream of messages 1, _ ; Data is read from the pipe as a stream of messages 0, _ ; Blocking mode is enabled 1, _ ; Maximum number of instances $BUFSIZE, _ ; Output buffer size $BUFSIZE, _ ; Input buffer size $TIMEOUT, _ ; Client time out 0) ; Default security attributes If $g_hPipe = -1 Then LogError("InitPipe ..........: _NamedPipes_CreateNamedPipe failed") Else ; Connect pipe instance to client ConnectClient() EndIf EndFunc ;==>InitPipe ; =============================================================================================================================== ; This function loops waiting for a connection event or the GUI to close ; =============================================================================================================================== Func MsgLoop() Local $iEvent Do $iEvent = _WinAPI_WaitForSingleObject($g_hEvent, 0) If $iEvent < 0 Then LogError("MsgLoop ...........: _WinAPI_WaitForSingleObject failed") Exit EndIf If $iEvent = $WAIT_TIMEOUT Then ContinueLoop Debug("MsgLoop ...........: Instance signaled") Switch $g_iState Case 0 CheckConnect() Case 1 ReadRequest() Case 2 CheckPending() Case 3 RelayOutput() EndSwitch Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>MsgLoop ; =============================================================================================================================== ; Checks to see if the pending client connection has finished ; =============================================================================================================================== Func CheckConnect() Local $iBytes ; Was the operation successful? If Not _WinAPI_GetOverlappedResult($g_hPipe, $g_pOverlap, $iBytes, False) Then LogError("CheckConnect ......: Connection failed") ReconnectClient() Else $g_iState = 1 EndIf EndFunc ;==>CheckConnect ; =============================================================================================================================== ; This function reads a request message from the client ; =============================================================================================================================== Func ReadRequest() Local $pBuffer, $tBuffer, $iRead, $bSuccess $tBuffer = DllStructCreate("char Text[" & $BUFSIZE & "]") $pBuffer = DllStructGetPtr($tBuffer) $bSuccess = _WinAPI_ReadFile($g_hPipe, $pBuffer, $BUFSIZE, $iRead, $g_pOverlap) If $bSuccess And ($iRead <> 0) Then ; The read operation completed successfully Debug("ReadRequest .......: Read success") Else ; Wait for read Buffer to complete If Not _WinAPI_GetOverlappedResult($g_hPipe, $g_pOverlap, $iRead, True) Then LogError("ReadRequest .......: _WinAPI_GetOverlappedResult failed") ReconnectClient() Return Else ; Read the command from the pipe $bSuccess = _WinAPI_ReadFile($g_hPipe, $pBuffer, $BUFSIZE, $iRead, $g_pOverlap) If Not $bSuccess Or ($iRead = 0) Then LogError("ReadRequest .......: _WinAPI_ReadFile failed") ReconnectClient() Return EndIf EndIf EndIf ; Execute the console command If Not ExecuteCmd(DllStructGetData($tBuffer, "Text")) Then ReconnectClient() Return EndIf ; Relay console output back to the client $g_iState = 3 EndFunc ;==>ReadRequest ; =============================================================================================================================== ; This function relays the console output back to the client ; =============================================================================================================================== Func CheckPending() Local $bSuccess, $iWritten $bSuccess = _WinAPI_GetOverlappedResult($g_hPipe, $g_pOverlap, $iWritten, False) If Not $bSuccess Or ($iWritten <> $g_iToWrite) Then Debug("CheckPending ......: Write reconnecting") ReconnectClient() Else Debug("CheckPending ......: Write complete") $g_iState = 3 EndIf EndFunc ;==>CheckPending ; =============================================================================================================================== ; This function relays the console output back to the client ; =============================================================================================================================== Func RelayOutput() Local $pBuffer, $tBuffer, $sLine, $iRead, $bSuccess, $iWritten $tBuffer = DllStructCreate("char Text[" & $BUFSIZE & "]") $pBuffer = DllStructGetPtr($tBuffer) ; Read data from console pipe _WinAPI_ReadFile($g_hReadPipe, $pBuffer, $BUFSIZE, $iRead) If $iRead = 0 Then LogMsg("RelayOutput .......: Write done") _WinAPI_CloseHandle($g_hReadPipe) _WinAPI_FlushFileBuffers($g_hPipe) ReconnectClient() Return EndIf ; Get the data and strip out the extra carriage returns $sLine = StringLeft(DllStructGetData($tBuffer, "Text"), $iRead) $sLine = StringReplace($sLine, @CR & @CR, @CR) $g_iToWrite = StringLen($sLine) DllStructSetData($tBuffer, "Text", $sLine) ; Relay the data back to the client $bSuccess = _WinAPI_WriteFile($g_hPipe, $pBuffer, $g_iToWrite, $iWritten, $g_pOverlap) If $bSuccess And ($iWritten = $g_iToWrite) Then Debug("RelayOutput .......: Write success") Else If Not $bSuccess And (_WinAPI_GetLastError() = $ERROR_IO_PENDING) Then Debug("RelayOutput .......: Write pending") $g_iState = 2 Else ; An error occurred, disconnect from the client LogError("RelayOutput .......: Write failed") ReconnectClient() EndIf EndIf EndFunc ;==>RelayOutput ; =============================================================================================================================== ; This function is called to start an overlapped connection operation ; =============================================================================================================================== Func ConnectClient() $g_iState = 0 ; Start an overlapped connection If _NamedPipes_ConnectNamedPipe($g_hPipe, $g_pOverlap) Then LogError("ConnectClient .....: ConnectNamedPipe 1 failed") Else Switch @error ; The overlapped connection is in progress Case $ERROR_IO_PENDING Debug("ConnectClient .....: Pending") ; Client is already connected, so signal an event Case $ERROR_PIPE_CONNECTED LogMsg("ConnectClient .....: Connected") $g_iState = 1 If Not _WinAPI_SetEvent(DllStructGetData($g_tOverlap, "hEvent")) Then LogError("ConnectClient .....: SetEvent failed") EndIf ; Error occurred during the connection event Case Else LogError("ConnectClient .....: ConnectNamedPipe 2 failed") EndSwitch EndIf EndFunc ;==>ConnectClient ; =============================================================================================================================== ; Dumps debug information to the screen ; =============================================================================================================================== Func Debug($sMessage) If $DEBUGGING Then LogMsg($sMessage) EndFunc ;==>Debug ; =============================================================================================================================== ; Executes a command and returns the results ; =============================================================================================================================== Func ExecuteCmd($sCmd) Local $tProcess, $tSecurity, $tStartup, $hWritePipe ; Set up security attributes $tSecurity = DllStructCreate($tagSECURITY_ATTRIBUTES) DllStructSetData($tSecurity, "Length", DllStructGetSize($tSecurity)) DllStructSetData($tSecurity, "InheritHandle", True) ; Create a pipe for the child process's STDOUT If Not _NamedPipes_CreatePipe($g_hReadPipe, $hWritePipe, $tSecurity) Then LogError("ExecuteCmd ........: _NamedPipes_CreatePipe failed") Return False EndIf ; Create child process $tProcess = DllStructCreate($tagPROCESS_INFORMATION) $tStartup = DllStructCreate($tagSTARTUPINFO) DllStructSetData($tStartup, "Size", DllStructGetSize($tStartup)) DllStructSetData($tStartup, "Flags", BitOR($STARTF_USESTDHANDLES, $STARTF_USESHOWWINDOW)) DllStructSetData($tStartup, "StdOutput", $hWritePipe) DllStructSetData($tStartup, "StdError", $hWritePipe) If Not _WinAPI_CreateProcess("", $sCmd, 0, 0, True, 0, 0, "", DllStructGetPtr($tStartup), DllStructGetPtr($tProcess)) Then LogError("ExecuteCmd ........: _WinAPI_CreateProcess failed") _WinAPI_CloseHandle($g_hReadPipe) _WinAPI_CloseHandle($hWritePipe) Return False EndIf _WinAPI_CloseHandle(DllStructGetData($tProcess, "hProcess")) _WinAPI_CloseHandle(DllStructGetData($tProcess, "hThread")) ; Close the write end of the pipe so that we can read from the read end _WinAPI_CloseHandle($hWritePipe) LogMsg("ExecuteCommand ....: " & $sCmd) Return True EndFunc ;==>ExecuteCmd ; =============================================================================================================================== ; Logs an error message to the display ; =============================================================================================================================== Func LogError($sMessage) $sMessage &= " (" & _WinAPI_GetLastErrorMessage() & ")" ConsoleWrite($sMessage & @LF) EndFunc ;==>LogError ; =============================================================================================================================== ; This function is called when an error occurs or when the client closes its handle to the pipe ; =============================================================================================================================== Func ReconnectClient() ; Disconnect the pipe instance If Not _NamedPipes_DisconnectNamedPipe($g_hPipe) Then LogError("ReconnectClient ...: DisonnectNamedPipe failed") Return EndIf ; Connect to a new client ConnectClient() EndFunc ;==>ReconnectClient
  10. I've learned so much from the AutoIt community and figured it is about time I start giving something back. I am open sourcing all my software and Complete Internet Repair is the first program I am releasing. Complete Internet Repair will give you a free option to attempt to repair everything internet related. With any repair utility, you will need to remember only two golden rules. Firstly; don't try to repair something that is not broken, you might break it. Secondly; Comnplete Internet Repair cannot repair it all, we are not like the all-seeing and all-knowing Oracle, we cannot anticipate each and every situation, but this all said; it should be able to help with most internet issues. Complete Internet Repair could help if you are experiencing any of the following problems: Internet or network problem after removing adware, spyware, virus, worm, Trojan horse, etc. Loss network connection after installing/uninstalling adware, spyware, antispam, vpn, firewall or other networking programs. Unable to access any website or can only access some websites. Pop-up error window with network related problem description. No network connectivity due to registry errors. DNS lookup problem. Fail to renew the network adapter’s IP address or other DHCP errors. Network connectivity issue with limited or no connections message. Windows update does not work. You are having problems connecting to secured websites (ex. Banking). Internet Explorer stopped working or crashes all the time. A few other internet errors, but we will not discuss all here. Update 22 October 2016 Exes are now signed. New installation utility. Now built on the ReBar Framework. New Update Notification System. Resources moved to external Dll files. Added support for Windows 10. New Interface. New Logging System. New Reset Rroxy Server Configuration. New Registry based Method for configuring Services. Cleaner Optimized Code. You can download Complete Internet Repair 3 and Source Code at: http://www.rizonesoft.com/downloads/complete-internet-repair/ The source code can be viewed on GitHub here. Please while you're there, give it a Star! Please let me know what you think and if you have any suggestions, I would love to hear about it.
  11. I want an AutoIT script to be able to open a given page, but also be able to check the HTTP status of the page and print out the status code in a message box. Looking through some of the documentation, I've found how to open a page in Internet Explorer and keep it as an object by doing this: $IE = _IECreate($google_url) ^^^ but how would I find the HTTP status 200 from here?
  12. I've written a bot that is loading down pictures from a website. Basically, it opens the website, saves the picture via context menu, and hits a button for loading the next pic. Unfortunately, the pics and my internet connection aren't always the same and it takes longer to load at times. Right now I've got a sleep(3000) in my code, but it isn't very efficient. I waste time if it loads faster than 3000ms, and the program fails if it takes more than 3000ms. So I wanted to make a function that waits until the picture has loaded, and then saves it. I don't know if that causes any problems with possible functions, but it isn't the tab that's loading. The loading circle doesn't appear. It's something on the website. I've adapted to program to chrome, so I'd have to rewrite it partially for the IE functions, so it'd be nice if there was a solution for chrome. --- Thanks!
  13. I was needing to check all my connected networks and check if there is internet connection. so I wrote this function. #include <MsgBoxConstants.au3> #include <Array.au3> Global $NLM_ENUM_NETWORK_CONNECTED = 0x01 ;~ Global $NLM_ENUM_NETWORK_DISCONNECTED = 0x02 ;~ Global $NLM_ENUM_NETWORK_ALL = 0x03 Global Enum $eName, $eIsConectedtoInternet Local $aNetworks = GetNetWorks() If @extended Then For $i = 0 To @extended - 1 ConsoleWrite("NetWork Name: " & $aNetworks[$i][$eName] & "| IsConectedToInternet: " & $aNetworks[$i][$eIsConectedtoInternet] & @CRLF) Next _ArrayDisplay($aNetworks, "NetWork Name|NetWork Is Conected to Internet") EndIf ;~ Success: Return an 2DArray[][] and sets @extended Ubound of Array ;~ Failure: Return 0 and set @extended 0 Func GetNetWorks($NLM_ENUM_NETWORK = $NLM_ENUM_NETWORK_CONNECTED) Local $aNetworks[0][2] ;[n][0]NetWorks Name|[n][1]isConnectedtoInternet Local $INetworks = 0 Local $ReDim = 0 Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") Local $oINetworkListManager = ObjCreate("{DCB00C01-570F-4A9B-8D69-199FDBA5723B}") ;Create INetworkListManager Object by CLSID If Not IsObj($oINetworkListManager) Then Return 0 $INetworks = $oINetworkListManager.GetNetworks($NLM_ENUM_NETWORK) If Not IsObj($INetworks) Then Return 0 For $INetwork In $INetworks $ReDim = UBound($aNetworks, 1) + 1 ReDim $aNetworks[$ReDim][2] $aNetworks[$ReDim - 1][0] = $INetwork.GetName $aNetworks[$ReDim - 1][1] = $INetwork.isConnectedtoInternet Next $oINetworkListManager = 0 ;Free Return SetExtended($ReDim, $aNetworks) EndFunc ;==>GetNetWorks ; User's COM error function. Will be called if COM error occurs Func _ErrFunc($oError) ; Do anything here. ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc Saludos
  14. Hello all, i need a script to complete surveys for me... something like this: open firefox go to specified URL wait till loaded fill forms submit wait till loaded check new URL repeat Could someone please suggest me the best way to do this?
  15. Internet Shortcut Sanitizer With the newest Firefox and IE browsers, there's a bit of an issue with Internet Shortcuts created, which have been traditionally saved in a .URL file on Windows (an INI-structured file). Firefox now adds Icon information to the file which points it at a location within %localappdata%MozillaProfiles. This to me is annoying and unnecessary. While it may reflect the favicon of a website, its got a few problems: When the cache is cleared or the bookmark is moved to another computer or put on a fresh install, that icon isn't there anymore. These shortcuts contain your logon name (part of %localappdata%), so be aware of this if you are going to share them! (or just use a generic logon) Here's the content of a typical Firefox .URL file (<LogonName> is your Windows logon): [InternetShortcut] URL=http://www.google.com/ IDList= HotKey=0 IconFile=C:\Users\<LogonName>\AppData\Local\Mozilla\Firefox\Profiles\a3n21a.default\shortcutCache\md34sdyu7s_g==.ico IconIndex=0 _ Update: if you have Firefox 21, you can follow and edit Firefox's about:config settings to fix the way URL shortcuts are created. Internet Explorer (IE 9+) now has its own new shortcut extension (.website), which seems to only work with the IE browser. These files are basically 'enhanced' internet shortcuts. The extra information included is cryptic, and appears to be of no use outside of IE. However, the INI-format is the same, and the [internetShortcut] section is the same, so it can simply be renamed to have a .URL extension. Here's the content of a typical Internet Explorer 9+ .website file: [{000214A0-0000-0000-C000-000000000046}] Prop4=31,Google Prop3=19,2 [{A7AF692E-098D-4C08-A225-D433CA835ED0}] Prop5=3,0 Prop9=19,0 [InternetShortcut] URL=http://www.google.com/ IDList= IconFile=http://www.google.com/favicon.ico IconIndex=1 [{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}] Prop12=19,2 Prop5=8,Microsoft.Website.9CB8E698.8730F9E8 _ (Note the embedded [internetShortcut] section) Sanitize your shortcuts! The fix for these problems? A little Internet Shortcut Sanitizer program. If you're like me and just want Internet Shortcuts to be just that - a simple file with a URL in it, then this program will give you what you need. It strips everything out but the 2 lines necessary to work as a .URL file: [InternetShortcut] URL=http://www.website.com _ The script will also create .URL's from .website files and remove all the IE related stuff. Currently it either takes 1 parameter or allows you to select 1 file to change. However, it can be adapted to work on multiple files with a little extra effort. However, I'd recommend something like grepWin to clear out folders (see 3rd post), and maybe a batch file renamer to deal with .website -> .URL conversion. Below is the script. Changelog: 2013-05-17: - Packaged the main functionality of the script into the embedded UDF: _InternetShortcutSanitize() ; ================================================================================================================== ; <InternetShortcutSanitizer.au3> ; ; 'Sanitizes' Internet shortcuts, both of the traditional Windows .URL format and of the newer IE .website format ; In the case of the latter, it will delete the .website variant and create a URL version ; ; Author: Ascend4nt ; ================================================================================================================== Local $sFile If $CmdLine[0] < 1 Then $sFile=FileOpenDialog("Select Internet Shortcut to Sanitize","","Internet Shortcut Files (*.URL;*.website)|All Files (*.*)",3) If @error Or $sFile="" Then Exit Else $sFile = $CmdLine[1] EndIf $sFile = StringStripWS($sFile,3) If Not FileExists($sFile) Then Exit ;~ ConsoleWrite("Internet Shortcut file to sanitize = "&$sFile&@CRLF) _InternetShortcutSanitize($sFile) ; =================================================================================================== ; Func _InternetShortcutSanitize($sFile) ; ; 'Sanitizes' the Internet shortcut file passed. This keeps URL files to a 2-line file of this format: ; [InternetShortcut] ; URL=http://www.website.com ; ; In the case the input file is an Internet Explorer .website shortcut (in IE 9+), it will ; create a .URL file of the same name, and upon successful write, it will delete the .website file. ; ; $sFile = Full path to file to sanitize ; ; Return: ; Success: True ; Failure: False with @error set ; ; Author: Ascend4nt ; =================================================================================================== Func _InternetShortcutSanitize($sFile) If $sFile = "" Then Return SetError(1,@error,False) ; Get rid of whitespace at beginning & end $sFile = StringStripWS($sFile,3) Local $sFileOut, $nRet Local $sURL = "", $sFileContent = "" $sURL = IniRead($sFile, "InternetShortcut", "URL", "") If @error Or $sURL = "" Then Return SetError(-1,@error,False) ;~ ConsoleWrite("URL = "&$sURL&@CRLF) ; Standard URL format $sFileContent = "[InternetShortcut]"&@CRLF&"URL="&$sURL&@CRLF ; $sFileOut: If not .website, we keep it the same. ; Otherwise, we transfer it to a .URL file If StringRight($sFile, 8) = ".website" Then $sFileOut = StringReplace($sFile, ".website", ".URL", -1) Else $sFileOut = $sFile EndIf ; Create/Overwrite the URL file $hFile = FileOpen($sFileOut, 2) If $hFile = -1 Then Return SetError(3, 0, False) $nRet = FileWrite($hFile, $sFileContent) FileClose($hFile) ; FileWrite error? If Not $nRet Then ;~ ConsoleWrite("File Write error"&@CRLF) Return SetError(4,0,False) EndIf ; .website -> .URL 'translation' performed? Delete .website file If $sFile <> $sFileOut Then ; Make sure we actually created the .URL file before delete: If FileExists($sFileOut) Then FileDelete($sFile) EndIf Return True EndFunc
  16. Hi I making a small tool that create wifi Hotspot use netsh cmd All command is ok But only sharing option that i dont know how to control That list all network for choice one network to share Then set properties Sharing I find any infomation about 2hour but i cant find anything I thinking about control click but it will not right for all windows version Please. Help me! Have you some ideas?
  17. So lets say I have the link : "autoitscript.com/forum/" How can I find if its HTTP or HTTPS secured or maybe other protocol ? I would prefer via the _IE UDFs if possible... Thanks in advance !
  18. So my problem was to download files from temporary links. If you consider Combofix, an util to clean Windows from malware, it's a program updated daily and I want always the last version. But the download link is temporary and always changing, and I don't trust other sites static links. I developed a system to download a list of links, the main idea is to have the list of links in the page and after I go parsing the list to found the correct temporary links. It's dirty but it's working. This is a "lite" version for the forum.: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Icone\Full ico\down.ico #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;NSC 2014 ; download temporary links demo #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <GuiEdit.au3> #include <IE.au3> #include <string.au3> Global $uProgress1, $UPDATE, $updateArray, $updateDownload, $downlist, $adown, $conta Global $downpath = @DesktopDir & "\GetDown" ;_________________ Gui() Prepare() downlist() downloop() end() Exit Func Gui() #Region ### START Koda GUI section ### Form=C:\Program Files (x86)\AutoIt3\Examples\NSC_test\formS\update.kxf $UForm1 = GUICreate("GET DOWN lite V.1.5", 300, 200, 200, 150) GUISetBkColor(0xC0C0C0) $uProgress1 = GUICtrlCreateProgress(265, 5, 30, 190, BitOR($PBS_SMOOTH, $PBS_VERTICAL, $WS_BORDER)) GUICtrlSetColor(-1, 0x0033FF) GUICtrlSetBkColor(-1, 0x000066) $UPDATE = GUICtrlCreateEdit("", 5, 5, 250, 190, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_BORDER)) GUICtrlSetData(-1, "Gettin'down temporary links" & @CRLF) GUICtrlSetFont(-1, 8, 800, 0, "Verdana") GUICtrlSetColor(-1, 0x99FFFF) GUICtrlSetBkColor(-1, 0x330000) GUICtrlSetCursor(-1, 3) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### EndFunc ;==>Gui Func Prepare() If Not FileExists($downpath) Then DirCreate($downpath) EndFunc ;==>Prepare Func downlist() Dim $adown[3] ; in other scripts I download a txt file from internet. $adown[0] = "http://www.bleepingcomputer.com/download/adwcleaner/dl/125/|adwcleaner.exe" $adown[1] = "http://www.bleepingcomputer.com/download/combofix/dl/12/|combofix.exe" $adown[2] = "http://www.bleepingcomputer.com/download/rkill/dl/10/|rkill.exe" _GUICtrlEdit_AppendText($UPDATE, "download list assigned. " & @CRLF) EndFunc ;==>downlist Func downloop() While 1 $filedown = _ArrayPop($adown) If @error <> 0 Then ExitLoop $arraydown = _StringExplode($filedown, "|") ; example of line processed "www.yourlinkhere.com|yourfile.exe" Local $oIE = _IECreate($arraydown[0], 0, 0, 1, 0) ;hidden IE Local $oLinks = _IELinkGetCollection($oIE) ; list of links! Local $iNumLinks = @extended _GUICtrlEdit_AppendText($UPDATE, "Searching in " & $iNumLinks & " links for " & $arraydown[0] & @CRLF) Local $sTxt = $iNumLinks & " links found" & @CRLF & @CRLF ; uncomment for list of links (1/3) For $oLink In $oLinks $sTxt &= $oLink.href & @CRLF ;uncomment for list of links (2/3) If StringInStr($oLink.href, $arraydown[1]) Then Inetdown($oLink.href, $arraydown[1]) EndIf Next MsgBox($MB_SYSTEMMODAL, "Link Info", $sTxt) ;uncomment for list of links (3/3) WEnd EndFunc ;==>downloop Func Inetdown($filedown, $nomefiledown) $updateDownload = InetGet($filedown, $downpath & "\" & $nomefiledown, 1, 1) _GUICtrlEdit_AppendText($UPDATE, "downloading " & $nomefiledown & @CRLF) Do Sleep(500) _GUICtrlEdit_AppendText($UPDATE, "bytes downloaded :" & InetGetInfo($updateDownload, 0) & @CRLF) GUICtrlSetData($uProgress1, (100 * InetGetInfo($updateDownload, 0) / InetGetInfo($updateDownload, 1))) Until InetGetInfo($updateDownload, 2) ; Check if the download is complete. InetClose($updateDownload) ; Close the handle to release resources. _GUICtrlEdit_AppendText($UPDATE, "downloaded in " & $downpath & @CRLF) EndFunc ;==>Inetdown Func end() Run("explorer.exe " & $downpath) MsgBox(64, "NSC GET DOWN", "Files downloaded!") EndFunc ;==>end the Function downloop() contains the trick. The complete version downloads from a public server the list of the files to download, and for every file there is a command to choose various download methods and to exucute commands (run the files etc) after the download, and at the end I have a mail with a report.
  19. Is it possible to use a different IP proxy before manipulating a web application or a web browser? If it is, then how can I achieve that? If not, then what is the alternative just to use a different IP proxy before web application manipulation? Thanks in advanced..
  20. How to set a value to the "Join the discussion…" textarea and then simulate a left mouse click of the "Post as {USERNAME}" button on the Disqus thread in my blog? Here is the URL of my blog: http://professionalserver.tk/php/wp/hello-world/ If my blog got slow, just wait a while before contributing to this topic! But before you can see the "Post as {USERNAME}" button on the comment system in that blog, you must first manually sign in with Disqus!
  21. Hello, I was looking around the net for a simple protable program to test whether you have an internet connection.. in short i couldnt find what i wanted so i wrote one. After looking on the forum i found some code snippets from others who had started to this kind of thing, but no completed project. Credits: Autoit Team / Autoit Program! ISN AutoIt Studio - '?do=embed' frameborder='0' data-embedContent>> Post: '?do=embed' frameborder='0' data-embedContent>> Autoitsnippet: http://www.autoitscript.com/wiki/AutoIt_Snippets#IsInternetConnected Function (by Guiness): '?do=embed' frameborder='0' data-embedContent>> I have attached the full code and compilied executable. All constructive comments / improvement ideas / actual coded example imporovements, welcome. Screenshots Version 2 Version 1 Update: 09/03/2014 - v1.3 - Added a sleep() to the program loop to prevent high constant cpu usage - credit: wakillon 09/03/2014 - v1.2 - Added in another test (Microsoft Windows Test #2) using a function written by auto it forum member Guiness 09/03/2014 - v1.1 - Removed unnecessary includes, moved global variables to the top of the code - Credit: wakillon / water Internet Connection Tester v1.3.zip
  22. I'm trying to create two sides; A client side and a server side. I've got each one to work and send data from the client to the server, but if two clients are sending data at the same time. I would like to be able to get both and not just have one send while the other one gets ignored. Is there anyway I can implement a buffer so that when one connection gets done the other then starts receiving from the second client? Here is my code. ~Client Side~ TCPStartup() HotKeySet("{Esc}", "Quit") Local $ip, $port, $data, $connect $ip = "*servers IP address here*" $port = 21230 $connect = TCPConnect($ip, $port) If @error Then ConsoleWrite("Could not connect to " & $ip) sleep(1000) Quit() EndIf message() ;ConsoleWrite($data) Sleep(3000) Quit() Func message() Local $File, $Line = "", $i = 0, $EOF = "" $File = FileOpen("tcpexample.txt", 0) If $File = -1 Then MsgBox(0, "Error", "Unable to read the file.") Exit EndIf Do $Line = FileReadLine($File) $EOF = @error ConsoleWrite($Line & @CRLF) TCPSend($connect, $Line) If @error Then ConsoleWrite("There was an error sending." & @CRLF) EndIf sleep(500) Until $EOF = -1 FileClose($File) EndFunc Func Quit() TCPShutdown() Exit EndFunc ~Server Side~ TCPStartup() HotKeySet("{Esc}", "Quit") Local $ip, $port, $Accept, $Listen, $AcceptError = True, $Result $Result = FileOpen("tcptest.txt", 1) $ip = @IPAddress1;try $IPAddress2/3/4 if this doesn't work $port = 21230 $Listen = TCPListen($ip, $port) If ($listen = - 1 or $listen = 0) and (@error = 1 or @error = 2) Then ConsoleWrite("TCPListen returned @error: " & @error) Quit() EndIf While 1 If $AcceptError = True Then AcceptConnection() EndIf If $AcceptError = False Then $recv = "" $recv = TCPRecv($Accept, 1024) If @Error Then ConsoleWrite("Connection timed out: " & $Accept & @CRLF) $AcceptError = True EndIf If $recv <> "" Then FileWriteLine($Result, $recv) ConsoleWrite("We received this: " & $recv & @CRLF) EndIf EndIf WEnd Func Quit() TCPShutdown() FileClose($Result) Exit EndFunc Func AcceptConnection() $AcceptError = True While 1 $Accept = TCPAccept($Listen) If $Accept <> -1 Then ConsoleWrite($accept & " has connected" & @CRLF) $AcceptError = False ExitLoop EndIf WEnd EndFunc
  23. Right now the fastest way I can mine someone's database is by making hundreds of individual executable that all do there on INETGET TCP Request, obviously this take up a lot of processing and RAM resources. Anyone know of a way I can make more requests for pages faster\more efficiently? My scripts that I run look something like this... ;A setprate script makes a txt file with part of a URL to go to #include <File.au3> #include <Array.au3> $htmlstore = @DesktopCommonDir & "\HTMLstore\" $FileList = _FileListToArray($htmlstore) For $count = 2 To $FileList[0] + 1 If FileExists($htmlstore & $count & ".txt") = 1 Then FileMove($htmlstore & $count & ".txt", $htmlstore & @AutoItPID & @ComputerName & ".txt") $file = FileOpen($htmlstore & @AutoItPID & @ComputerName & ".txt") $PID = FileRead($file) FileClose($file) $hDownload = InetGet("http://www.ocpafl.org/Searches/ParcelSearch.aspx/PID/" & $PID, $htmlstore & $PID & ".html", 1) InetClose($hDownload) ; Close the handle to release resources. FileDelete($htmlstore & @AutoItPID & @ComputerName & ".txt") Exit EndIf Next If you need more info let me know. Any recommendations would be appreciated
  24. Hello AU3Forum, I have a Internet Explorer window opened( I thinks its somehow a control class in IE,but anyway ) and I need to retrieve or take all the links from that page. How can I do this ??
  25. When running the following code, line 3 causes $script_browser to no longer be an Internet Explorer object, which you can see in the error messages caused by lines 5 & 7. #include <IE.au3> $script_browser = _IECreate() _IENavigate($script_browser, @ScriptDir& "\step1.html") Sleep(2500) _IENavigate($script_browser, @ScriptDir& "\step2.html") Sleep(2500) _IENavigate($script_browser, @ScriptDir& "\step3.html") --> IE.au3 V2.4-0 Error from function _IENavigate, $_IEStatus_InvalidObjectType --> IE.au3 V2.4-0 Error from function _IENavigate, $_IEStatus_InvalidObjectType
×
×
  • Create New...