Krentenbol78 Posted December 2, 2007 Share Posted December 2, 2007 Hi I am working with a script and I wan't to read a textfile from a site.For example:http://mysite.com/textfile.txtI wan't to read what's inside the file and display it in a messagebox.I already searched bud couldn't find something usefull(I don't want the text file embed but just what's in the text file stored in $file)Thanks alot ! Link to comment Share on other sites More sharing options...
Developers Jos Posted December 2, 2007 Developers Share Posted December 2, 2007 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 More sharing options...
Krentenbol78 Posted December 3, 2007 Author Share Posted December 3, 2007 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 More sharing options...
Developers Jos Posted December 3, 2007 Developers Share Posted December 3, 2007 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 More sharing options...
Krentenbol78 Posted December 3, 2007 Author Share Posted December 3, 2007 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 Link to comment Share on other sites More sharing options...
Developers Jos Posted December 3, 2007 Developers Share Posted December 3, 2007 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 More sharing options...
picaxe Posted December 3, 2007 Share Posted December 3, 2007 I think this is what Jos meant by reload, from InetGet help InetGet ( "URL" [,"filename" [, reload [, background]]] ) Link to comment Share on other sites More sharing options...
Zedna Posted December 3, 2007 Share Posted December 3, 2007 (edited) 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 December 3, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now