autoitxp Posted September 29, 2013 Share Posted September 29, 2013 _LoadVarHTTP("http://127.0.0.1:89/loadvars/files/update.txt") is it possible to load value of variable from url .txt file ? file contain like $server1 = server1.1234.com $server2 = server2.1234.com Func _LoadVarHTTP($URLtoLoad) Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") If @error Then Return $oHTTP.Open("GET", $URLtoLoad, False) If @error Then Return $oHTTP.Send() If @error Then Return ;$oHTTP.WaitForResponse ConsoleWrite($oHTTP.Status & @CRLF) If $oHTTP.Status <> $HTTP_STATUS_OK Then Return Local $oHTTPSource = $oHTTP.Responsetext Local $oHTTPFileOpen = FileOpen(@ScriptDir & '\' & test.txt 2) FileWrite($oHTTPFileOpen, $oHTTPSource) FileClose($oHTTPFileOpen) ConsoleWrite($oHTTPSource) EndFunc ;==>_LoadVarHTTP Link to comment Share on other sites More sharing options...
mrflibblehat Posted September 30, 2013 Share Posted September 30, 2013 if you are asking what I think you are have a look at the IniRead function.http://www.autoitscript.com/autoit3/docs/functions/IniRead.htm [font="'courier new', courier, monospace;"]Pastebin UDF | Prowl UDF[/font] 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