资源简介
EncryptQtDemo.rar
代码片段和文件信息
#include “encryptqtdemo.h“
#include
#include
#include “cstring“
EncryptQtDemo::EncryptQtDemo(QWidget *parent Qt::WFlags flags)
: QMainWindow(parent flags)
{
m_ui.setupUi(this);
//connect(m_ui->encryptBtn SIGNAL(clicked()) this SLOT(DocEncrypt()));
//connect(m_ui->decryptBtn SIGNAL(clicked()) this SLOT(DocDecrypt()));
}
EncryptQtDemo::~EncryptQtDemo()
{
}
void EncryptQtDemo::DocEncrypt()
{
QString filename(QString(“D:\\1.pdf“));
QString fileEncrypt((QString(“D:\\temp.pdf“)));
QFile original(filename);
if(!original.open(QIODevice::ReadOnly))
return;
QByteArray ba = original.readAll().tobase64();
original.close();
while (!original.remove()){}
QFile dest(fileEncrypt);
if(!dest.open(QIODevice::WriteOnly))
return;
dest.write(ba);
dest.close();
dest.rename(fileEncrypt filename);
}
void EncryptQtDemo::DocDecrypt()
{
QString fileEncrypt = (QString(“D:\\1.pdf“));
QString fileDecrypt = (QString(“D:\\temp.pdf“));
QFile file(fileEncrypt);
if(!file.open(QIODevice::ReadWrite))
return;
QFile defile(fileDecrypt);
QByteArray ba = QByteArray::frombase64(file.readAll());
file.close();
while (file.remove()){}
if(defile.open(QIODevice::WriteOnly))
defile.write(ba);
defile.close();
defile.rename(fileDecrypt fileEncrypt);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1330 2018-11-23 11:16 encryptqtdemo.cpp
文件 397 2018-11-23 10:21 encryptqtdemo.h
文件 73 2018-11-23 09:40 encryptqtdemo.qrc
文件 1065 2018-11-23 10:20 encryptqtdemo.ui
文件 10758 2018-11-23 09:40 EncryptQtDemo.vcxproj
文件 2723 2018-11-23 09:40 EncryptQtDemo.vcxproj.filters
文件 581 2018-11-23 09:44 EncryptQtDemo.vcxproj.user
文件 217 2018-11-23 10:19 main.cpp
----------- --------- ---------- ----- ----
17144 8
- 上一篇:glove6B
- 下一篇:Qt异或实现文件加解密.rar
相关资源
- Qt异或实现文件加解密.rar
- smallpdf1.20.0无限时间版.rar
- 383C开发大全(提高卷)源码.rar
- IsoHeightCtrl.zip
- 0145、低成本可调数显稳压电源(1.3
- refined_Lee_fliter.rar
- shadowsocks-libev_2.5.5-1_amd64_Ubuntu14.04.de
- 普林斯顿微积分读本视频列表.txt
- WannaCry勒索病毒一键加固脚本v1.05by叉
- WINDOWS聊天课程设计报告
- sccm.txt序列号.txt
- 8taesy.rar
- luke1215_10971614.txt
- MyTest.zip
- FFMpeg_SDK_详细中文指南开发手册.pdf
- NMSPublishSubscribe.zip
- 序列号吗.txt
- 完美DDOS破解版.rar
- 智慧树刷课.txt
- xmr-CentOS6_64bit-rebuild-20181019.zip
- xmr-CentOS7_64bit-rebuild-20181019.zip
- 东华HIS数据库表结构.docx
- vrt0el.zip
- 《xxxx》游戏屏蔽词库.docx
- 04.mpu6050_dmp.zip
- longyue1859_5563031.zip
- wincc报表.part2.rar
- Fuzzycontrol使用经验手册.pdf
- Unicursal.rar
- ifive_mini3视网膜版本_miui小米系统内存
评论
共有 条评论