I want to generate a serial number for an application (to be used just in a period of time), this serial number based on the time, so it's will be unnecessary code if change the clock time in my computer so am asking you if is there any possibility to get the real DateTime even if i changes time on my computer using C# ?
(I assume that the user does not have an internet connection)
am asking you if is there any possibility to get the real DateTime even if i changes time on my computer using C# ?
(I assume that the user does not have an internet connection)
No. The system clock is the local source of time information. If you can't go to a reliable external source (due to a lack of internet connection) there's nothing else you can rely on.
I suggest you use an internet connection to check the time if there is one, otherwise fall back on the system clock, possibly detect time having been reversed significantly (if at one point you "see" the time as April 20th, and then at another you "see" the time as April 15th, you can assume something odd is going on) and accept that a sufficiently motivated user will bypass the check.
See more on this question at Stackoverflow