Atitit ATI LicenseService Design principle
C:\0workspace\AtiPlatf\src_atibrow\com\attilax\license\LicenseX.java
V1
More time to be super
V2 According to the percentage of slow time .
draft V3:
Laicense file, Hto sh aes time:
Invoke
System. out.println( Licensex.iscanuse_byusepercent("2016-05-01") );
Author :: ★ (Attilax) >>> nickname : old Wow's paw   (   full name:: ATTILAX AKBAR AL RAPANUI  Attilax   Baroque   Alpha   Rapa Nui   )   Kanji name: Ayron, Email:[email protected]
reprint Please indicate source: http://www.cnblogs.com/attilax/
Private int usepercent(String Last_check_time) {
String d= "2016-09-01";
Date D= Dateutil.str2date(Last_check_time, false);
if(New Date().GetTime()<=D.GetTime())
return ;
int Dayinterval = Dateutil.Getdayinterval(D,New Date());
&NBSP; if ( dayinterval > 100 )
&NBSP; return 0 ;
&NBSP; dayinterval 100 - dayinterval
return dayinterval ;
}
Public Boolean iscanuse_byusepercent(String Last_check_time) {
int Use=usepercent(last_check_time );
int RDM= RANDOMX.Random(1, -);
if (rdm<=use)
return true;
Else
return false;
}
Atitit ATI LicenseService Design principle