當前位置:首頁 » 編程語言 » java注冊碼

java注冊碼

發布時間: 2023-01-03 01:48:14

A. java 編程 序列號

//哎....

import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.ParseException;
import javax.swing.*;
import javax.swing.text.MaskFormatter;

public class CodeTest extends JFrame {
private static final long serialVersionUID = 1L;
private JFormattedTextField formatField = null;
private JButton ba = null;
private String pattern = "AAAAA-AAAAA-AAAAA-AAAAA";
private JLabel code = new JLabel("注冊碼: ");
private JLabel input = new JLabel("序列號: ");
private JTextField codeField = new JTextField();
private JLabel rel = new JLabel();

public CodeTest(){
init();
}

public void init(){
MaskFormatter mft = CodeTest.getFormatter(pattern);
mft.setPlaceholderCharacter('X');
formatField = new JFormattedTextField();
formatField = new JFormattedTextField();
mft.install(formatField);
this.setBounds(200, 200, 240, 240);
this.setResizable(false);
this.setLayout(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
formatField.setBounds(30, 30, 180, 25);
ba = new JButton("注冊");
ba.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
if(formatField.getText().length() >= 1) {

}
String text = formatField.getText();
long vlong = getCode(text);
code.setText("注冊碼: (" + vlong + ")");
if((vlong + "").equals(codeField.getText())){
rel.setText("注冊成功!");
System.exit(0);
} else {
rel.setText("注冊失敗!");
}
}
});
codeField.setBounds(30, 85, 180, 25);
code.setBounds(30, 60, 180, 25);
ba.setBounds(30, 125, 180, 25);
rel.setBounds(30, 155, 100, 25);
input.setForeground(Color.RED);
code.setForeground(Color.RED);
rel.setForeground(Color.RED);
input.setBounds(30, 5, 100, 25);
this.add(rel);
this.add(codeField);
this.add(input);
this.add(code);
this.add(ba);
this.add(formatField);
ba.setDefaultCapable(true);

this.setVisible(true);
}

public static void main(String[] args) {
new CodeTest();

}

public static MaskFormatter getFormatter(String pattern){
try {
return new MaskFormatter(pattern);
} catch (ParseException e) {
e.printStackTrace();
return null;
}
}

public long getCode(String text){
char [] chs = text.toCharArray();
long vlong = 0;
for(char c: chs){
if(c != '-'){
vlong += 199 * (int)c;
}
}
return vlong;
}

}

B. JAVA用戶注冊 (我要源代碼)

跑這兒作家庭作業了? 如果連用哪種頁面技術都不知道提的話,恐怕別人給你源代碼你也看不懂哦,想想別人給你個tapestry、Wicket之類的寫的代碼,拿給老師肯定挨批的喲(一看就露餡了)。

C. Java如何實現軟體注冊功能

是聯網注冊還是單機注冊?
聯網的話就是你要寫個接受手機軟體發送的信息的服務端。
單機的話就是你要獲得可以唯一標識手機的代碼,告知你後通過一定演算法得出注冊碼,然後發送給用戶

D. java編程詞典個人版如何跳過注冊碼

文件夾內的exe替換安裝目錄的同名文件。
java編程詞典個人版直接用文件夾內的exe替換安裝目錄的同名文件不需要客戶獲取注冊碼即可直接打開。
《Java編程詞典(個人版)》是明日科技為Java各級程序開發人員和編程愛好者開發的專業編程資源庫,它提供了海量的開發資源、豐富的實例項目、靈活的查詢方式、多樣的學習模式,既可以幫助零基礎者快速入門,又可以幫助有一定基礎者快速提升開發水平,更適合各級程序開發人員隨時檢索查詢,隨時粘貼復用。Java編程詞典個人版是程序開發人員的左膀右臂,軟體工程師必備的專業指南。

熱點內容
路由器訪問光貓 發布:2025-07-04 22:07:47 瀏覽:896
資料庫顯示語句 發布:2025-07-04 22:04:30 瀏覽:739
編程課道具 發布:2025-07-04 22:04:02 瀏覽:843
華為手機不是安卓什麼時候可以更新米加小鎮 發布:2025-07-04 22:01:37 瀏覽:785
飢荒伺服器搭建視頻 發布:2025-07-04 21:48:38 瀏覽:523
github上傳文件夾 發布:2025-07-04 21:29:22 瀏覽:1003
php課程學習中心 發布:2025-07-04 21:29:16 瀏覽:298
win7加密文件夾如何解密 發布:2025-07-04 21:25:24 瀏覽:555
為啥系統緩存的垃圾多呢 發布:2025-07-04 21:15:45 瀏覽:952
linux路由伺服器 發布:2025-07-04 21:13:57 瀏覽:7