今天帶來的java小項目實現(xiàn)文件加密解密,核心代碼已展示出來
界面展示:


部分代碼展示:
package wt.diy.encryption.gui;
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import wt.diy.encryption.service.ServiceContext;
public class Context {
ServiceContext service;
EncryptionFrame frame;
public Context(ServiceContext service) {
this.service = service;
}
public void setFrame(EncryptionFrame frame) {
this.frame = frame;
}
public void excute(String source,String destiny, String key,JFrame frame) {
File file = new File(destiny);
if(!this.frame.getRadio().isSelected()&&file.exists()){
JOptionPane.showMessageDialog(frame, “文件已經(jīng)存在”);
return ;
}
service.excute(source, destiny, key);
}
public void showMe(){
frame.setVisible(true);
}
public String open(JFrame frame) {
JFileChooser jfc = new JFileChooser();
jfc.showOpenDialog(frame);
File f = jfc.getSelectedFile();
return f.getAbsolutePath();
}}
另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
本文名稱:如何用Java實現(xiàn)文件的加密與解密-創(chuàng)新互聯(lián)
瀏覽路徑:http://chinadenli.net/article42/edgec.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供自適應網(wǎng)站、網(wǎng)站改版、網(wǎng)站導航、小程序開發(fā)、網(wǎng)站策劃、標簽優(yōu)化
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容