|
-
Nov 10th, 2008, 08:02 PM
#1
Thread Starter
Lively Member
[RESOLVED] [2003] Getting the right Date
In the program im working on, it has a time trial version. Right now I have the program pulling the system date into a variable and checking it with a date file it creates when it is first used.
The only problem with this is all the user would have to do when the time trial ran out is set the date on the computer back. Is there a way to pull a date into a variable that can not be changed by the user?
My car if Chevy was VB.NET
Code:
Public Class MyCar
Public Sub Camaro()
Dim Camaro As Car
Camaro = SS.Fast("Sexy")
End Sub
Public Function Fast(ByVal sexy As String ) As String
Return "SUPER" & sexy
End Function
End Class
-
Nov 10th, 2008, 08:23 PM
#2
Re: [2003] Getting the right Date
You could get the date from a time server on the Web, as long as you don't mind enforcing an Internet connection every time your app is run.
The only other way to cope with this is to record the time each time the app exits, then compare the current time to that when it starts up. It doesn't guarantee that the user won't turn their clock back but it does guarantee that it always goes forward for each run so the time will eventually run out. The user could always just increment the time by a few seconds each time they run the app but doing that would be a real pain so someone would have to be very determined to bother.
The other issue is where you store this information so the user can't edit or delete it.
-
Nov 10th, 2008, 08:39 PM
#3
Thread Starter
Lively Member
Re: [2003] Getting the right Date
Okay, so how would I get the date off a date and time server?
BTW sorry if you guys are tired of seeing me post questions. Still learning ;-D
My car if Chevy was VB.NET
Code:
Public Class MyCar
Public Sub Camaro()
Dim Camaro As Car
Camaro = SS.Fast("Sexy")
End Sub
Public Function Fast(ByVal sexy As String ) As String
Return "SUPER" & sexy
End Function
End Class
-
Nov 10th, 2008, 08:41 PM
#4
Re: [2003] Getting the right Date
Never done it myself. I think it's a specific protocol but I'm not really sure.
-
Nov 10th, 2008, 08:44 PM
#5
Thread Starter
Lively Member
Re: [2003] Getting the right Date
ok thanks. Ill figure somthing out. To tell the truth I dont really like the idea of
enforcing a connection everytime the program is run. Thanks
My car if Chevy was VB.NET
Code:
Public Class MyCar
Public Sub Camaro()
Dim Camaro As Car
Camaro = SS.Fast("Sexy")
End Sub
Public Function Fast(ByVal sexy As String ) As String
Return "SUPER" & sexy
End Function
End Class
-
Nov 10th, 2008, 08:55 PM
#6
Re: [2003] Getting the right Date
 Originally Posted by jmcilhinney
Never done it myself. I think it's a specific protocol but I'm not really sure.
I'm not sure but the Network Time Protocol, NTP, could be whats needed here.
http://support.ntp.org/bin/view/Serv..._A_Time_Server
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|