Jump to content

Recommended Posts

Posted

Hello, i'm trying to use InetRead to get some information from a website, in my computer this script works fine, but in a specific computer it don't work

Local $a= InetRead("https://meuarquivoteste.weebly.com/uploads/1/1/6/8/116881805/test.txt",16)
Local $b = BinaryToString($a)
MsgBox(0,"",$b)

I also tried with winhttp.winhttprequest.5.1, works fine for me, but don't work on the another computer

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET", "https://meuarquivoteste.weebly.com/uploads/1/1/6/8/116881805/test.txt", False)
$oHTTP.Send()
$oReceived = $oHTTP.ResponseText
$oStatusCode = $oHTTP.Status
MsgBox(0,"",$oReceived)

 

 

problema2.png

  • Developers
Posted

You state that InetRead() is having a problem .. and then go on in your initial post showing 2 pieces of code and an error, which is from the second scriptlet ...right?

So for the first script: Have you checked what the returned error information is like described in the helpfile?

Quote

Return Value

Success: a binary string and @extended set to the number of bytes downloaded.
Failure: "" (empty string) and sets the @error flag to non-zero.

For the Second script: Add an ComErrorHandler to your script and check the information of the error. This is the only way to get more inside as to why it fails on that particular pc.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted
Quote

You state that InetRead() is having a problem .. and then go on in your initial post showing 2 pieces of code and an error, which is from the second scriptlet ...right?

Yes.

I got "1" error from inetread 

and this with the second script:

SbG5sqAJTxS0H1O7awBlmg.png

Posted

@Israelks, welcome to the AutoIt forum.

the obvious cause would be that the "other computer" has connectivity issues with the target URL. the first COM error (which is the only important one, since the successive erroneous operations depend on the first one) hints of a DNS issue. is that "other computer" inside a corporate network? or protected by some additional means, such as a firewall?

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

WinPose - simultaneous fluent move and resize

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

Magic Math - a math puzzle

Demos:

Title Bar Menu - click the window title to pop-up a menu

 

Posted (edited)
3 hours ago, orbs said:

 

is that "other computer" inside a corporate network?

No,

 

3 hours ago, orbs said:

or protected by some additional means, such as a firewall?

i've tried disable the firewall but i got the same error, maybe the problem is DNS? how to know if the problem is DNS?

 

Edited by Israelks
Posted

open a browser and type the full URL in the address bar (and press "Enter"). see if you get the text inside the file, or any error message.

additional reading (first result when google "resolve dns issues")

 

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

WinPose - simultaneous fluent move and resize

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

Magic Math - a math puzzle

Demos:

Title Bar Menu - click the window title to pop-up a menu

 

Posted

The issue seems IE related, this occurs frequently with Weebly
The address in the code - as well as this one - doesn't work in my (old) IE browser
You might try to update IE to the latest version

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
×
×
  • Create New...