30-day trial help

30-day trial help

Page 1 of 1

5 Replies - 531 Views - Last Post: 23 March 2009 - 05:22 PM Rate Topic: -----

#1 tripseven  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-March 09

30-day trial help

Posted 22 March 2009 - 08:59 PM

Hi. Im hoping someone can show me how to make this code a 30-day trial. I have no idea what code to write or where to write it to achieve this. Any help would be highly appreciated. Its written with Visual C++

Thanks



#include<fstream.h>
#include<stdlib.h>
#include<math.h>

	double theta, theta_temp, y, z, ny, nz, ty, tz;

int main()
{	 
	cout <<endl <<" Enter Angle to Rotate: ";
	cin >>theta;
	cout <<endl <<" Enter Y Axis Machine Number for Centerline of Rotation: ";
	cin >>ty;
	cout <<endl <<" Enter Z Distance from Top of Setblock to Centerline of Rotation: ";
	cin >>tz;
	cout <<endl <<" Enter Distance from Centerline of Rotation to Work Offset Y0: ";
	cin >>y;
	cout <<endl <<" Enter Distance from Centerline of Rotation to Work Offset Z0: ";
	cin >>z;

	theta_temp = theta;
	theta = theta/180 * 3.1415926535897932384626433832795;


	ny = ny - ty;
	nz = nz - tz;


	ny = sin(theta) * z + cos(theta) * y;
	nz = cos(theta) * z - sin(theta) * y;


	ny = ny + ty;
	nz = nz + tz;


	cout <<endl <<endl <<" New Y and Z Coordinates Rotated " <<theta_temp <<" Degrees" <<endl;
	cout <<endl <<"  Y = "<<ny;
	cout <<endl <<"  Z = "<<nz <<endl <<endl <<endl;

	return 0;
}


** Edit ** :code:

This post has been edited by no2pencil: 22 March 2009 - 10:07 PM


Is This A Good Question/Topic? 0
  • +

Replies To: 30-day trial help

#2 UG Cyber  Icon User is offline

  • D.I.C Addict

Reputation: 32
  • View blog
  • Posts: 546
  • Joined: 24-July 08

Re: 30-day trial help

Posted 22 March 2009 - 10:06 PM

View Posttripseven, on 22 Mar, 2009 - 07:59 PM, said:

Hi. Im hoping someone can show me how to make this code a 30-day trial. I have no idea what code to write or where to write it to achieve this. Any help would be highly appreciated. Its written with Visual C++

Thanks



#include<fstream.h>
#include<stdlib.h>
#include<math.h>

	double theta, theta_temp, y, z, ny, nz, ty, tz;

int main()
{	 
	cout <<endl <<" Enter Angle to Rotate: ";
	cin >>theta;
	cout <<endl <<" Enter Y Axis Machine Number for Centerline of Rotation: ";
	cin >>ty;
	cout <<endl <<" Enter Z Distance from Top of Setblock to Centerline of Rotation: ";
	cin >>tz;
	cout <<endl <<" Enter Distance from Centerline of Rotation to Work Offset Y0: ";
	cin >>y;
	cout <<endl <<" Enter Distance from Centerline of Rotation to Work Offset Z0: ";
	cin >>z;

	theta_temp = theta;
	theta = theta/180 * 3.1415926535897932384626433832795;


	ny = ny - ty;
	nz = nz - tz;


	ny = sin(theta) * z + cos(theta) * y;
	nz = cos(theta) * z - sin(theta) * y;


	ny = ny + ty;
	nz = nz + tz;


	cout <<endl <<endl <<" New Y and Z Coordinates Rotated " <<theta_temp <<" Degrees" <<endl;
	cout <<endl <<"  Y = "<<ny;
	cout <<endl <<"  Z = "<<nz <<endl <<endl <<endl;

	return 0;
}


*Code tags fixed*

Well there is a couple ways of doing this....In windows you could include the windows header (windows.h) and use SYSTEMTIME struct to get the current date. Record it into a file or the registry, then 30 days from the recorded date, show a message box (MessageBox() ) that tells the user that the product has expired.

on linux.....good luck. Just about everything is free in linux.
Was This Post Helpful? 0
  • +
  • -

#3 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

Re: 30-day trial help

Posted 22 March 2009 - 10:29 PM

View PostUG Cyber, on 23 Mar, 2009 - 12:06 AM, said:

on linux.....good luck. Just about everything is free in linux.

There's nothing stopping someone from doing the same thing (checking against the time) in Linux.
Was This Post Helpful? 0
  • +
  • -

#4 UG Cyber  Icon User is offline

  • D.I.C Addict

Reputation: 32
  • View blog
  • Posts: 546
  • Joined: 24-July 08

Re: 30-day trial help

Posted 23 March 2009 - 06:21 AM

View PostTom9729, on 22 Mar, 2009 - 09:29 PM, said:

View PostUG Cyber, on 23 Mar, 2009 - 12:06 AM, said:

on linux.....good luck. Just about everything is free in linux.

There's nothing stopping someone from doing the same thing (checking against the time) in Linux.



But why would you want to....And i have had a bit of a problem getting the time in linux, but i don't want to jack his topic
Was This Post Helpful? 0
  • +
  • -

#5 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

Re: 30-day trial help

Posted 23 March 2009 - 09:36 AM

View PostUG Cyber, on 23 Mar, 2009 - 08:21 AM, said:

But why would you want to....And i have had a bit of a problem getting the time in linux, but i don't want to jack his topic

http://www.java2s.co...measastring.htm
Was This Post Helpful? 0
  • +
  • -

#6 krzysz00  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 83
  • Joined: 25-February 09

Re: 30-day trial help

Posted 23 March 2009 - 05:22 PM

System time(linux)(deliveder as # of seconds since 1/1/1970)
#include<time.h>
int time = time();
//write to file if file nonexistent
int filetime = //get time from file
if(time - filetime == (60 * 60 * 24 * 30))
{
  //do something
}


This is probably cross-platform since time.h is in the standard library
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1