啟用MyEclipse 6.5方法-通過一段Java程式產生啟用碼

來源:互聯網
上載者:User

標籤:

在MyEclipse中建立一個Java類,名為MyEclipseKeyGen,將下面的Java代碼拷貝到MyEclipseKeyGen類中,先修改變數subscriber的值,然後運行程式即可獲得Subscription Code。將subscriber和subscriptionCode輸入所示地區,點擊“OK”,即可啟用MyEclipse6.5(通過測試,本人已成功啟用)。其他的MyEclipse版本暫沒有測試過。

 1 import java.text.DecimalFormat; 2 import java.text.NumberFormat; 3 import java.text.SimpleDateFormat; 4 import java.util.Calendar; 5  6 public class MyEclipseKeyGen { 7  8     public static final void main(String[] args){ 9         String subscriber = "yuxinwangjing";  //subscriber10         String licenseNum = "500";  //Number of Licenses11         String version = "100"; //版本號碼12         String subscriptionCode = getSubscriptionCode(subscriber, version , licenseNum ,true);13         System.out.println(subscriptionCode);  //gLR8ZO-655055-6267705652275705114     }15     16     public static String getSubscriptionCode(String subscriber, String version, String licenseNum, boolean selected) {17         Calendar cal = Calendar.getInstance();18         cal.add(1, 3);  //年份加三年19         cal.add(6, -1);  //日期減一//當前日期20141226,到期日則為2017122520         NumberFormat nf = new DecimalFormat("000");21         licenseNum = nf.format(Integer.valueOf(licenseNum));22         String verTime = selected ? (new StringBuffer("-")).append((new SimpleDateFormat("yyMMdd")).format(cal.getTime())).append("0").toString() : "-0812310";23         String type = "YE3MB-";24         String need = (new StringBuffer(String.valueOf(subscriber.substring(0,1)))).append(type).append(version).append(licenseNum).append(verTime).toString();25         String dx = (new StringBuffer(String.valueOf(need))).append("Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (http://www.loc.gov/copyright/legislation/dmca.pdf). Under section 1204 of the DMCA, penalties range up to a $500,000 fine or up to five years imprisonment for a first offense. Think about it; pay for a license, avoid prosecution, and feel better about yourself.").append(subscriber).toString();26         int suf = decode(dx);27         String code = (new StringBuffer(String.valueOf(need))).append(String.valueOf(suf)).toString();28         return change(code);29     }30     31     private static int decode(String s) {32 33         int i = 0;34         char ac[] = s.toCharArray();35         int j = 0;36         for (int k = ac.length; j < k; j++)37         i = 31 * i + ac[j];38         return Math.abs(i);39     }40     41     private static String change(String s) {42         byte abyte0[] = s.getBytes();43         char ac[] = new char[s.length()];44         int i = 0;45         for (int k = abyte0.length; i < k; i++) {46             int j = abyte0[i];47             if (j >= 48 && j <= 57)48             j = ((j - 48) + 5) % 10 + 48;49             else if (j >= 65 && j <= 90)50             j = ((j - 65) + 13) % 26 + 65;51             else if (j >= 97 && j <= 122)52             j = ((j - 97) + 13) % 26 + 97;53             ac[i] = (char) j;54         }55         return String.valueOf(ac);56     }57 }

 

啟用MyEclipse 6.5方法-通過一段Java程式產生啟用碼

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.