# 30-day trial help

Page 1 of 1

## 5 Replies - 919 Views - Last Post: 23 March 2009 - 05:22 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=94715&amp;s=975e1ebacce4b21f55793f8dec1bf12a&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 tripseven

• New D.I.C Head

Reputation: 0
• 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 **

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

• D.I.C Addict

Reputation: 36
• Posts: 611
• Joined: 24-July 08

## Re: 30-day trial help

Posted 22 March 2009 - 10:06 PM

tripseven, 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

• Segmentation fault

Reputation: 181
• Posts: 2,642
• Joined: 30-December 07

## Re: 30-day trial help

Posted 22 March 2009 - 10:29 PM

UG 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

• D.I.C Addict

Reputation: 36
• Posts: 611
• Joined: 24-July 08

## Re: 30-day trial help

Posted 23 March 2009 - 06:21 AM

Tom9729, on 22 Mar, 2009 - 09:29 PM, said:

UG 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

• Segmentation fault

Reputation: 181
• Posts: 2,642
• Joined: 30-December 07

## Re: 30-day trial help

Posted 23 March 2009 - 09:36 AM

UG 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

• D.I.C Head

Reputation: 3
• 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

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }