成人AV在线无码|婷婷五月激情色,|伊人加勒比二三四区|国产一区激情都市|亚洲AV无码电影|日av韩av无码|天堂在线亚洲Av|无码一区二区影院|成人无码毛片AV|超碰在线看中文字幕

qt讀取ini配置文件 如何使用Qt加密解密類庫QCA?

如何使用Qt加密解密類庫QCA?下載:類庫和插件:crypto copy to:QT installation directorydesktopQT4.7.4MinGWpluginscrypto qt

如何使用Qt加密解密類庫QCA?

下載:類庫和插件:crypto copy to:QT installation directorydesktopQT4.7.4MinGWpluginscrypto qtfeautre:feature copy to:QT installation directorydesktopQT4.7.4MinGWmkspecsfeatures使用類庫時,需要:1。將“config=crypto”添加到QT項目文件Pro 2中。將“openssl-win32bin”目錄中的ssleay32.dll和libeay32.dll復制到項目的調(diào)試或發(fā)布目錄。三。將“qca-2.0.3lib”目錄和“qca-ossl-2.0.0-beta3lib”目錄復制到項目的調(diào)試或發(fā)布目錄。4在程序中使用QCA之前,請使用QCA::initializerinit初始化QCA

~]#<qcryptographicshash>

#include<QSettings>

#include<QDebug>

//生成MD5 Hash

QString testustring(“MD5 Hash的測試字符串”)

QByteArray MD5uhash

MD5uhash=qcryptographicshash::Hash(testu字符串.toUtf8(), qcryptographicshash::Md5)

QString md5hashuu字符串=Md5u哈希.toHex()

qDebug()<<“MD5 Hash:”<< md5hashuu字符串

//寫入MD5u哈希.ini

QSettings md5writeFile(QString(“md5u哈希.ini“”,QSettings::IniFormat)

md5writeFile.setValue(QLatin1String(“MD5 Hash”),MD5uhash)

MD5writeFile.sync文件()

//從md5讀取哈希.ini

QSettings md5readFile(QString(“md5u哈希.ini“”,QSettings::IniFormat)

md5讀取文件.sync()

如果(真==md5readFile.contains文件(“MD5 Hash”){

QByteArray MD5 array=MD5readFile.value文件(“MD5 Hash”).toByteArray()

qDebug()<<“從文件讀取的MD5 Hash:”<< MD5數(shù)組.toHex()

}以上代碼純手工敲打和QT驗證,請珍惜使用。