MyEclipse-6.5 Note Code generator source code

Source: Internet
Author: User
Tags generator readline dmca

Open MyEclipse Create a new javaproject, and then create a new class, paste such as the following code, you can generate MyEclipse's manual code

Importjava.io.BufferedReader;
Importjava.io.IOException;
Importjava.io.InputStreamReader;

public class myeclipsegen{
private static final String LL = "Decompiling This copyrightedsoftware is a violation of both your license agreement and T Hedigital Millenium Copyright Act of 1998 (Http://www.loc.gov/copyright/legislation/dmca.pdf). Under sections 1204 of the DMCA, penalties range up to a $500,000fine or up to five years imprisonment for a first offense. Thinkabout it; Pay for a license, avoid prosecution, and feel betteraboutyourself. ";

public string Getserial (string userId, String licensenum) {
Java.util.Calendar Cal =java.util.calendar.getinstance ();
Cal.add (1,3);
Cal.add (6,-1);
Java.text.NumberFormat NF = newjava.text.DecimalFormat ("000");
Licensenum =nf.format (integer.valueof (licensenum));
String vertime = Newstringbuilder ("-"). Append (
Newjava.text.SimpleDateFormat ("YyMMdd"). Format (Cal.gettime ()))
. Append ("0"). toString ();
String type = "ye3mp-";
String need = Newstringbuilder (userid.substring (0,1)). Append (Type)
. Append (""). Append (Licensenum). Append (Vertime). toString ();
String dx = newstringbuilder (Need). Append (LL). Append (UserId)
. toString ();
int Suf =this.decode (dx);
String code = Newstringbuilder (Need). Append (string.valueof (SUF))
. toString ();
Returnthis.change (code);
}

private int decode (String s) {
Inti
Char[]ac;
INTJ;
INTK;
i = 0;
AC =s.tochararray ();
j = 0;
K =ac.length;
while (J < K) {
i = (* i) +ac[j];
j + +;
}
Returnmath.abs (i);
}

private string Change (string s) {
BYTE[]ABYTE0;
Char[]ac;
Inti
INTK;
INTJ;
Abyte0 =s.getbytes ();
AC = Newchar[s.length ()];
i = 0;
K =abyte0.length;
while (I < k) {
J =abyte0[i];
if ((J >=) && (J <= 57)) {
j = ((((j-48) + 5)% 10) +48;
} else if ((J >=) && (j<= 90)) {
j = ((((j-65) + 13)% 26) +65;
} else if ((J >=) && (j<= 122)) {
j = ((((j-97) + 13)% 26) +97;
}
Ac[i] = (char) j;
i++;
}
Returnstring.valueof (AC);
}

Public Myeclipsegen () {
Super ();
}

public static void Main (string[] args) {
try{
SYSTEM.OUT.PRINTLN ("Please input registername:");
BufferedReader reader = Newbufferedreader (Newinputstreamreader (
system.in));
Stringuserid =null;
UserId =reader.readline ();
Myeclipsegenmyeclipsegen = Newmyeclipsegen ();
String Res =myeclipsegen.getserial (userId, "5");
System.out.println ("Serial:" +res);
Reader.readline ();
} catch (IOException ex) {
}
}
}

MyEclipse-6.5 Note Code generator source code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.