91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小:
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-10
  • 語言: Java
  • 標(biāo)簽: 文件加密??

資源簡介

資源截圖

代碼片段和文件信息


import?java.awt.*;
import?java.awt.event.*;
import?java.io.*;
import?javax.swing.*;

public?class?KeyPay?extends?Jframe?{

int?shu1;

JLabel?jl1?jl2;

String?cc;

JButton?queding?xuanz?jiami?jiemi;

JTextField?lujin?key;

JTextArea?nr;

JRadioButton?qu?xie;

ButtonGroup?fz;

File?f;

public?KeyPay()?{
???Container?c?=?getContentPane();
???JPanel?jp1?=?new?JPanel();
???jl1?=?new?JLabel(“輸入路徑“);
???lujin?=?new?JTextField(15);
???xuanz?=?new?JButton(“選擇“);
???jp1.add(jl1);
???jp1.add(lujin);
???jp1.add(xuanz);
???c.add(jp1?BorderLayout.NORTH);

???nr?=?new?JTextArea();
???c.add(new?JScrollPane(nr)?BorderLayout.CENTER);

???qu?=?new?JRadioButton(“寫入“);
???xie?=?new?JRadioButton(“取出“?true);
???fz?=?new?ButtonGroup();
???fz.add(qu);
???fz.add(xie);

???jl2?=?new?JLabel(“密鑰“);
???key?=?new?JTextField(15);
???jiami?=?new?JButton(“加密“);
???jiemi?=?new?JButton(“解密“);
???JPanel?jp4?=?new?JPanel();
???jp4.setLayout(new?GridLayout(2?1?5?5));
???JPanel?jp2?=?new?JPanel();
???jp2.add(jl2);
???jp2.add(key);
???jp2.add(jiami);
???jp2.add(jiemi);
???jp4.add(jp2);

???JPanel?jp3?=?new?JPanel();
???queding?=?new?JButton(“確定“);
???jp3.add(qu);
???jp3.add(xie);
???jp3.add(queding);
???jp4.add(jp3);

???c.add(jp4?BorderLayout.SOUTH);
???queding.addActionListener(new?ActionListener()?{
????public?void?actionPerformed(ActionEvent?event)?{
?????jian();
?????if?(qu.isSelected())
??????shuchu();
?????if?(xie.isSelected())
??????qu();
????}
???});
???xuanz.addActionListener(new?ActionListener()?{
????public?void?actionPerformed(ActionEvent?event)?{
?????JFileChooser?fileChooser?=?new?JFileChooser();?//?實(shí)例化文件選擇器
?????fileChooser
???????.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);?//?設(shè)置文件選擇模式此處為文件和目錄均可
?????if?(fileChooser.showOpenDialog(KeyPay.this)?==?JFileChooser.APPROVE_OPTION)?{?//?彈出文件選擇器并判斷是否點(diǎn)擊了打開按鈕
??????String?fileName?=?fileChooser.getSelectedFile()
????????.getAbsolutePath();?//?得到選擇文件或目錄的絕對(duì)路徑
??????lujin.setText(fileName);
?????}
????}
???});

???jiemi.addActionListener(new?ActionListener()?{
????public?void?actionPerformed(ActionEvent?event)?{
?????objectInputStream?input;
?????try?{
??????input?=?new?objectInputStream(new?FileInputStream(lujin
????????.getText()));
??????int?mima?=?Integer.parseInt(key.getText());
??????AA?ac?=?(AA)?input.readobject();
??????if?(ac.getShu()?==?mima)?{
???????nr.setText(ac.cc);
???????shuchu();
??????}?else?{
???????nr.setText(“錯(cuò)誤的key“);
??????}
?????}?catch?(Exception?e)?{
??????//?e.printStackTrace();
??????nr.setText(“無法解密“);
?????}

????}
???});

???jiami.addActionListener(new?ActionListener()?{
????public?void?actionPerformed(ActionEvent?event)?{
?????AA?a?=?new?AA(nr.getText());
?????key.setText(a.shu?+?““);
?????try?{
??????objectOutputStream?output?=?new?objectOutputStream(
????????new?FileOutputStream(lujin.getText()));
??????output.writeobject(a);
??????output.flush();
????

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件???????2798??2012-02-18?15:36??4.文本加密\Demo4.txt

?????文件????????648??2011-01-07?11:46??4.文本加密\文本加密\AA.class

?????文件????????679??2011-01-07?11:46??4.文本加密\文本加密\KeyPay$1.class

?????文件????????871??2011-01-07?11:46??4.文本加密\文本加密\KeyPay$2.class

?????文件???????1223??2011-01-07?11:46??4.文本加密\文本加密\KeyPay$3.class

?????文件???????1438??2011-01-07?11:46??4.文本加密\文本加密\KeyPay$4.class

?????文件???????4216??2011-01-07?11:46??4.文本加密\文本加密\KeyPay.class

?????文件???????5180??2010-12-09?08:13??4.文本加密\文本加密\KeyPay.java

?????文件????????770??2011-12-13?19:35??4.文本加密\賀士兵加密\jiemi.java

?????文件????????985??2011-12-13?19:18??4.文本加密\賀士兵加密\wenjian.java

?????文件????????690??2011-12-12?10:28??4.文本加密\賀士兵加密\文件實(shí)驗(yàn).txt

?????文件??????49152??2011-12-12?12:26??4.文本加密\賀士兵加密\新建?Microsoft?Word?文檔.doc

?????文件????????971??2011-12-12?20:12??4.文本加密\賀士兵加密\新建?文本文檔?(2).txt

?????文件???????1079??2011-12-12?11:20??4.文本加密\賀士兵加密\新建?文本文檔.txt

?????目錄??????????0??2012-03-03?14:45??4.文本加密\文本加密

?????目錄??????????0??2012-03-03?14:45??4.文本加密\賀士兵加密

?????目錄??????????0??2012-03-03?14:45??4.文本加密

-----------?---------??----------?-----??----

????????????????70700????????????????????17


評(píng)論

共有 條評(píng)論