Jump to content

Read file


Recommended Posts

  • Developers

Something like:

InetGet("http://mysite.com/textfile.txt","targetfile")
$text=FileRead("targetfile")
MsgBox(0,"demo",$text)

:)

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

Link to comment
Share on other sites

Thanks ^_^

But I have a problem if I modify the data in the file on the server it doesn't show in the programm :)

So if I modify the file to 1 it's should show a messagebox but it doesn't work for some reason.

Help please :)

;#NoTrayIcon

#include <GUIConstants.au3>




While 1
InetGet("http://krentenbol78.freehostia.com/file.txt","file.txt")
$result=FileRead("file")
Sleep(500)
FileDelete(@ScriptDir&"file.txt")
If $result=1 Then
MsgBox(0,"",$result)
EndIf
WEnd
Link to comment
Share on other sites

  • Developers

Probably the file is already in cache so have you tried the reload parameter on the InetGet() ?

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

Link to comment
Share on other sites

  • Developers

Yeah I already thought that was the problem but how do I do that.

You can see in the script that I tried to load the file and than delete the file but it doesn't work.

Do you have an idea ?

Thanks alot for all you're help ^_^

Did you check the helpfile for the parameter ? :)

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

Link to comment
Share on other sites

I think there was also problem in error checking:

;#NoTrayIcon

#include <GUIConstants.au3>

While 1
$ok = InetGet("http://krentenbol78.freehostia.com/file.txt",@ScriptDir & "file.txt")
If $ok Then
$result=FileRead(@ScriptDir & "file")
$ok = Not @Error
Sleep(500)
FileDelete(@ScriptDir & "file.txt")
If $ok Then
MsgBox(0,"",$result)
EndIf
EndIf
Sleep(3000)
WEnd
Edited by Zedna
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...