If you need to get date in your application and be sure, that user had no chance to manipulate with it, you can use following snippet.

  1. //This function returns local computer time on network failure (user offline)
  2. public DateTime GetNetworkTime()
  3. {
  4.     return TreeksLicensingLibrary.NetworkTime.TryGetNetworkTime;
  5. }
  6.  
  7. //This function raises an exception when user goes offline
  8. public DateTime GetNetworkTimeUnhandled()
  9. {
  10.     return TreeksLicensingLibrary.NetworkTime.GetNetworkTime;
  11. }
  1. 'This function returns local computer time on network failure (user offline)
  2. Public Function GetNetworkTime As DateTime
  3.     Return TreeksLicensingLibrary.NetworkTime.TryGetNetworkTime
  4. End Function
  5.  
  6. 'This function raises an exception when user goes offline
  7. Public Function GetNetworkTimeUnhandled as DateTime
  8.     Return TreeksLicensingLibrary.NetworkTime.GetNetworkTime
  9. End Function