I think the first question to ask here is why do you want to set the System Time, and how does that relate to your making a trial version of an application. Most users set the System Time by automatically synchronizing with on-line Time Providers, these days.
I, and I think a lot of other users, would be quite upset by any application, particularly a trial version, changing their System DateTime down at the fundamental Windows' internals level !
If what you really want to is compare the real system time with the install date/time of your trial app: well then make your trial app fetch the real current time, based on the current time zone of the machine your trial app is installed on ... if what you are worried about is the end-user extending the period of trial by their setting their System DateTime manually back in time.
However: you asked a specific question: here's the best answer I can come up with:
This is going to require you use API calls from C#.
First, you must have the security permissions required to change the system date/time: specifically the SE_SYSTEMTIME_NAME permission. For information about using special permissions:[
^].
Here's the MSDN example that shows you how to do this, via API calls:[
^].
For a C# example of how to use these API calls, see:[
^].
This CP article deals with how to achieve Administrator privileges in Vista, but may be relevant:[
^]
Disclaimer: I have never needed to do this myself, so the resources above have not been personally used and tested.