
Issues with InetRead, BinaryToString, and StringBetween
By
xiantez, in AutoIt General Help and Support
-
Similar Content
-
By Blueman
Hi all,
I was wondering if you can help me with the function called; InetRead().
My scripts are using this function a lot for several conditions and everything works fine!
But sometimes when the server is a little bit buggy of simply not available my script is hanging.
It takes about 90sec before this function returns a Timeout, when i adjust the parameter it still is hanging about 90sec.
The following script is a example where the script is hanging for aprox. 90sec;
; Set Timeout to 2sec AutoItSetOption ("TCPTimeout", 2000) ; Read Website InetRead("http://www.geenverbinding.nl/",1) ; Show Msgbox before Ending Script. Msgbox(64,"","Finished")
The following script is a example where the script show the Msgbox pretty fast;
; Set Timeout to 2sec AutoItSetOption ("TCPTimeout", 2000) ; Read Website InetRead("http://www.google.nl/",1) ; Show Msgbox before Ending Script. Msgbox(64,"","Finished")
My question now is, what am i doing wrong and/or is there a other way to prevent Hanging the script?
Thanks all
-
By 31290
Hi everyone, hope you are doing fine
Well, I'm currently writing a small script that goes to a certain web page, finds the first link of a specified section and download the file associated to this link.
Depending on the computer that the tool is launched, the script gets the computer model and search in the (provided here) ini file which link to follow.
At first, Dell was kind enough to provide only one link but now, they provide two of them. The first one is now a .txt file ( ) whereas my script has been designed to download only the fist and latest link released for the BIOS Update.
Here's the current code which is working with only the first and latest link of the BIOS category:
So the question is:
In the case of double links like shown in the picture above, how it is possible to tell the script to download only the link containing an the .exe file?
Of course, I could have changed the array result to [1] instead of [0] [which is working] but it seems that Dell does that randomly and that I deal with a lot of computer models.
Thanks for the help you can provide,
-31290-
SEE_BIOS_LINKS.ini
-
By rootx
There is a way to have a clean string value without any SOH STX etc... Values
#include <FileConstants.au3> #include <String.au3> #include <WinAPI.au3> #include <Array.au3> #include <File.au3> $file = _FileListToArrayRec(@ScriptDir,"*.otf",1,1,0,2) For $x = 1 to UBound($file)-1 ;ConsoleWrite(_ReadOffSet($ISO[$x],0x000000,12)) ConsoleWrite(_HexToString(StringStripWS(_ReadOffSet($file[$x],0x000000,16), 8))&@CRLF) $String = StringReplace(BinaryToString(_ReadOffSet($file[$x],0x000000,16)), Chr(0), "") FileWrite(@ScriptDir&"\file.txt",$String&@CRLF) FileWrite(@ScriptDir&"\file2.txt",_HexToString(StringStripWS(_ReadOffSet($file[$x],0x000000,16), 8))&@CRLF) Next Func _ReadOffSet($sFilePath,$iOffset,$iLen=1) Local $sRet="" Local $hFile=FileOpen($sFilePath,$FO_BINARY) FileSetPos($hFile,$iOffset,$FILE_BEGIN) $sRet=FileRead($hFile,$iLen) FileClose($hFile) Return $sRet EndFunc
-
By Mark917
I am trying to extract a date and time from a website using InetRead. The source for the page I am reading shows the date and time as shown below. I need to somehow extract the correct date and time from this information. Is there a function or calculation that will do this? The source shown here correlates to 15:20 (time) 29.03.17 (date).
<div class="cell game-date" data-time="1490818800000"> <div class="site__time" data-time="1490818800000"> <div class="time"></div> <div class="date"></div> </div> </div> -
By carl1905
Hi. I'm looking forward to adding another language option for BinaryToString.
Basically, it only supports ANSI, UTF-8, UTF16 Little Endian, and UTF16 Big Endian. https://www.autoitscript.com/wiki/BinaryToString
Is there any way to adding Shift-JIS(Japanese, CP 932) and EUC-KR(Korean, CP 949)?
-