nadeem0035 Posted October 21, 2011 Share Posted October 21, 2011 #include<Date.au3> MsgBox(64, "DD/MM/YYYY", _NowDate()) Dear this is code to get date from local machine... I want to get this date from server machine because some time our machine date may be wrong or changed .. I want exact date through server using internet. Please help and tell code for this?????????? Link to comment Share on other sites More sharing options...
sleepydvdr Posted October 21, 2011 Share Posted October 21, 2011 (edited) I think you should look at solving the problem rather than monitoring it. The way I would approach this problem is to periodically check the current time from a server on the internet. Some code like this: #include <INet.au3> $source = _INetGetSource("http://tycho.usno.navy.mil/cgi-bin/timer.pl") MsgBox(0, "", $source) Then write some code to extract the time zone closest to you. Add or subtract the hours needed to adjust for your time zone. Then you could use _Date_Time_SetSystemTime to set the time. You could use Window's Task Scheduler to run the script every day or every few hours. Edited October 21, 2011 by sleepydvdr #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
nadeem0035 Posted October 21, 2011 Author Share Posted October 21, 2011 Good job.......... But i want to use this for monitoring purpose to secure our program or tell me other way to secure my program for trial period. Link to comment Share on other sites More sharing options...
sleepydvdr Posted October 21, 2011 Share Posted October 21, 2011 I am sorry. I completely misunderstood what you were asking. This is what you need: #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
nadeem0035 Posted October 21, 2011 Author Share Posted October 21, 2011 I am sorry. I completely misunderstood what you were asking. This is what you need: Yessssssssssss Like some thing but i want used simple to get date from server and match the script date and decide run or not using if condition ... Is it possible if then how ???????????????????????????? Thankssssss Link to comment Share on other sites More sharing options...
sleepydvdr Posted October 21, 2011 Share Posted October 21, 2011 I think that in order to do that, you would have to set up an NTP time server and somehow make it broadcast publicly. Or you may be able to set up a website that always displays the current date/time and use similar code from my first post to check it. Kind of like the Naval website did it. Think about this: what if they are using a laptop and cannot connect to the internet? What if your server is down? Does that mean that everyone who has your software will not be able to use it? #include <ByteMe.au3> 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