Hallo Mdamen,
Ziet er goed uit, maar helaas werkt het weer eens niet bij mij.
Ik heb even als test de code in een .vb gezet, en dmv een event uitgevoerd.
Code: Select all
const iWindrichting = "360"
const iWindsnelheid = "22"
const iWatertemperatuur = "24"
sUrl = "http://de_url.tld/receive.php"
sRequest = "windrichting=" & iWindrichting & Chr(38) & "windsnelheid=" & iWindsnelheid & Chr(38) & "watertemperatuur=" iWatertemperatuur
HTTPPost sUrl, sRequest
Function HTTPPost(sUrl, sRequest)
set oHTTP = CreateObject("Microsoft.XMLHTTP")
oHTTP.open "POST", sUrl,false
oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oHTTP.setRequestHeader "Content-Length", Len(sRequest)
oHTTP.send sRequest
HTTPPost = oHTTP.responseText
End Function
De fout die ik krijg is:
Code: Select all
8/25/2010 8:07:53 AM Error Script compile error: Declaratie wordt verwacht.on line 18
Code: Select all
8/25/2010 8:07:53 AM SCR Option Strict Offimports Schedulerimports SystemPublic Module scriptcode29#Region "Automatically generated code, do not modify"'Automatically generated code, do not modify'Event Sources Begin Public WithEvents hs As Scheduler.hsapplication Public WithEvents hsp As scheduler.hsp Public WithEvents hssystem As scheduler.phone0'Event Sources End'End of automatically generated code#End Regionconst iWindrichting = "360"const iWindsnelheid = "22"const iWatertemperatuur = "24"sUrl = "http://de_url.tld/receive.php"sRequest = "windrichting=" & iWindrichting & Chr(38) & "windsnelheid=" & iWindsnelheid & Chr(38) & "watertemperatuur=" iWatertemperatuurHTTPPost sUrl, sRequestFunction HTTPPost(sUrl, sRequest) set oHTTP = CreateObject("Microsoft.XMLHTTP") oHTTP.open "POST", sUrl,false oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" oHTTP.setRequestHeader "Content-Length", Len(sRequest) oHTTP.send sRequest HTTPPost = oHTTP.responseTextEnd FunctionEnd Module