System clock
Hi.
Does anyone knows how to use the systemclock in the controller in a RAB 5.10 application?
I would like to create a simple licensing function for my applications.
I want the user/company to fill in a licensecode after 30 days to be able to continue using the application.
Therefore I need the time from the systemclock to compere installationday with actual day.
Maybe there are someone that have done this before and can give some advise or the complete code?
Best regards
Magnus Johnson
Comments
-
I've not tested it myself but this is from the FPSDK manual:
This example retrieves the controller name and the current date and time and displays the information in a GTPUMessageBox . private void DisplayNameNnTime(Controller myControllerRef)
{
// Get the name of the controller
string name = myControllerRef.Name;// Get current date and time
DateTime now = myControllerRef.DateTime;// Compose text
string text = string.Format("Name of controller is: {0}
Current date is: {1}
and the time is: {2}:{3}",name,
now.Date.ToString(), now.Hour, now.Minute);// Display message box
GTPUMessageBox.Show(this,
new MessageBoxEventHandler(MyMessageBoxEventHandler),
text,
"System Information",
System.Windows.Forms.MessageBoxIcon.Asterisk,
System.Windows.Forms.MessageBoxButtons.OK);
}But be aware that if you base your check only on the system time, then it would be simple for me to change the controller time and thus circumvent your license check. That is why some programs instead say that you can run them X times before you need to license them.
John
Developer Center0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings