Qt浅谈之五十三linux下开发软锁用于软件授权使用

本文介绍了在CentOS 6.4环境下,如何使用Qt创建一个软锁系统用于软件授权。通过自定义加密算法和Qt界面,实现了软件的简单加密。内容包括代码结构解析和编译运行步骤,但具体代码未公开。
摘要由CSDN通过智能技术生成

一、简介

        centos6.4下自己写的代码需要进行简单的加密处理,使用第三方的加密需要费用。于是利用Qt界面配合自己写了一套加密算法,一般也是可以保证安全的。效果如下:

 

二、详解

1、代码

(1)autosetup.h

#ifndef WIDGET_H
#define WIDGET_H

#include <QtCore>
#include <QtGui>
#include <QWidget>
#include <QProgressBar>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <unistd.h>
#include "custombtn.h"
#include "vmcontrol.h"
#include "waitting_label.h"
#include "calendarselected.h"
#include "licensehelper.h"
using namespace RJ_LICENSE;

class AutoSetup : public QWidget
{
    Q_OBJECT

public:
    AutoSetup(QWidget *parent = 0);
    ~AutoSetup();

protected:
    void paintEvent(QPaintEvent *event);
    void resizeEvent(QResizeEvent *event );

    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);

private:
    QPoint dragPosition;
    bool bPressFlag;

    QPixmap backGroundPix;
    QPixmap logoIcon;
    QColor backGroundColor;

    CustomBtn *closeBtn;
    QLabel *titleLabel;
    QLabel *displayInfoLabel;
    QLabel *progressLabel;
    QTextBrowser *textBrowser;
    QProgressBar *progressBar;

    QLabel    *driverLabel;
    CustomBtn *requestBtn;
    VmmLineEdit *requestLineEdit;
    CustomBtn *licenseBtn;
    VmmLineEdit *licenseLineEdit;

    QLabel *timeLabel;
    CalendarSelected *calendarTime;
    QCheckBox *foreverCheckBox;
    CustomBtn *generateBtn;

    RotatingLabel *waittingLable;

private:
    void check_all_btn_status();

private slots:
    void slotRequestBtn();
    void slotLicenseBtn();
    void slotforeverCheckBox(bool checked);
    void slotGenerateBtn();
    void slotTextChanged(const QString &text);
    void slotCloseWin();
};

#endif // WIDGET_H

(2)autosetup.cpp

#include "autosetup.h"
#include "messageinfo.h"
//#include "initmanager.h"
#include "appinitview.h"
#include "licensehelper.h"
using namespace RJ_LICENSE;

AutoSetup::AutoSetup(QWidget *parent)
    : QWidget(parent, Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint)
    ,bPressFlag(false)
{
    QString _version = "";
    QString titleText = tr("Ruijie") + _version + tr("Setup Wizard");
    titleLabel = new QLabel(this);
    titleLabel->setText(titleText);
    titleLabel->setStyleSheet("color:#FFFFFF");
    titleLabel->setFont(QFont("arial", 12, QFont::Bold));

    /***************bakeground********************/
    backGroundPix = QPixmap(":/resources/images/formDialog.png");
    backGroundPix = backGroundPix.scaled(440, 440, Qt::IgnoreAspectRatio,Qt::SmoothTransformation);
    logoIcon = QPixmap(QString(":/resources/images/logo.png"));
    resize(backGroundPix.width(),  backGroundPix.height());
    backGroundColor = QColor(0xFF,0xF
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

乌托邦2号

博文不易,支持的请给予小小打赏

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值