Justforfun Posted December 19, 2010 Share Posted December 19, 2010 Ok I am stuck. What I want to do sounds very simple but I think I a complicating it myself. All I want to do is get the current time and date from the internet and have it display in a MsgBox, I can not seem to figure out how to retrieve the information from on line. Example site " http://free.timeanddate.com/clock/i2dkat1s/n104/tt1/tw0/tm2/td1 ". So like: $ip = http://free.timeanddate.com/clock/i2dkat1s/n104/tt1/tw0/tm2/td1 $info = ; command to check or retrieve time and date from $ip MsbBox( 0, "Current Time and Date", "Current: " & $info) Somthing like that I just dont know what command to use to accomplish this. Please Help Thank You. Link to comment Share on other sites More sharing options...
Justforfun Posted December 19, 2010 Author Share Posted December 19, 2010 (edited) I find it odd that you would want to get the time from the internet instead of your computer. This code should work for the link you posted though. $ip = "http://free.timeanddate.com/clock/i2dkat1s/n104/tt1/tw0/tm2/td1" $info = BinaryToString(InetRead($ip)) $aRegEx = StringRegExp($info, "(?s)<span id=t1>(.*?)</span>", 3) MsgBox(0, "Current Time and Date", "Current: " & $aRegEx[0]) I have a script I use to set a trial period for a program the problem I have found is that when it compares the time written to reg key when the program was first ran to the computers time it works but if you set the computers time back it will make the program usable again. So I want to compare it to a time and date that they can not change. Make sense Also Thank you very much works perfectly Edited December 19, 2010 by Justforfun Link to comment Share on other sites More sharing options...
DCCD Posted December 19, 2010 Share Posted December 19, 2010 I have a script I use to set a trial period for a program the problem I have found is that when it compares the time written to reg key when the program was first ran to the computers time it works but if you set the computers time back it will make the program usable again. So I want to compare it to a time and date that they can not change. Make sense Also Thank you very much works perfectly Another one return "-1" if something fails #include <String.au3> ;_Date(0) Success: A 0 based $Date[$ap] contains the first found string. MsgBox(0, "", _Date(0)) Func _Date($ap) Local $Date If InetGet("http://free.timeanddate.com/clock/i2dkat1s/n104/tt1/tw0/tm2/td1", @TempDir & "\~data.tmp") Then $Date = FileRead(@TempDir & "\~data.tmp") $Date = _StringBetween($Date, "<span id=t1>", "</span>", -1) FileDelete(@TempDir & "\~data.tmp") If $ap < UBound($Date) Then Return $Date[$ap] EndIf Return SetError(1, 0, -1) EndFunc ;==>_Date Regards . [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group Link to comment Share on other sites More sharing options...
Justforfun Posted December 19, 2010 Author Share Posted December 19, 2010 (edited) It makes a bit more sense now. Couldn't they just change the registry key though or do you have the key encrypted?I am using _StringEncrypt command to encrypt the reg key. Thanks for asking though just incase I didnt encrypt it. Edited December 19, 2010 by Justforfun Link to comment Share on other sites More sharing options...
Justforfun Posted December 19, 2010 Author Share Posted December 19, 2010 It just occurred to me that they could just delete the whole key and get a new one. Do you have a system to prevent that?Um nope but it would be a bit of a challenge to find because it is not named after the program 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