Example #1
0
        /// <summary>
        /// 零水印算法调度
        /// </summary>
        private void Switch_algorithm1()
        {
            MarkProducer myMark = new MarkProducer();

            switch (algorithm1)
            {
            case 1:
                flag = (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4);
                if (flag == false)
                {
                    MessageBox.Show("零水印参数导入出错!", "操作提示");
                }
                else
                {
                    MarkProducer login = new MarkProducer();
                    login.set_Hamming(zeroHarmming);
                    markLocate1       = login.Logistic(parameter1, parameter2, markBit, sourceDBInfo);
                    dataInfo          = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, sourceDBInfo[2]);
                    watermark         = myMark.initWaterMark(dataInfo, markBit, 2);
                    txtWaterMark.Text = watermark;
                }
                break;

            case 2:
                flag = (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4) &&
                       (parameter3 < 1) && (parameter3 > 0) && (parameter4 >= 3.57) && (parameter4 <= 4);
                if (flag == false)
                {
                    MessageBox.Show("零水印参数导入出错!", "操作提示");
                }
                else
                {
                    MarkProducer login = new MarkProducer();
                    login.set_Hamming(zeroHarmming);
                    markLocate1       = login.Logistic(parameter1, parameter2, markBit, sourceDBInfo);
                    dataInfo          = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, sourceDBInfo[2]);
                    watermark         = myMark.initWaterMark(dataInfo, markBit, 2);
                    txtWaterMark.Text = myMark.LogisticChaos(parameter3, parameter4, watermark);
                }
                break;

            case 3:
            {
                flag = true;
                MarkProducer login = new MarkProducer();
                login.set_Hamming(zeroHarmming);
                markLocate1       = login.SuperChaos(parameter1, parameter2, parameter3, parameter4, markBit, sourceDBInfo);
                dataInfo          = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, sourceDBInfo[2]);
                watermark         = myMark.initWaterMark(dataInfo, markBit, 2);
                txtWaterMark.Text = watermark;
            }
            break;

            default:
                MessageBox.Show("零水印算法导入出错!", "操作提示");
                break;
            }
        }
 /// <summary>
 /// 零水印算法调度
 /// </summary>
 private void Switch_algorithm1()
 {
     MarkProducer myMark = new MarkProducer();
     switch (algorithm1)
     {
         case 1:
             flag = (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4);
             if (flag == false)
             {
                 MessageBox.Show("零水印参数导入出错!", "操作提示");
             }
             else
             {
                 MarkProducer login = new MarkProducer();
                 markLocate1 = login.Logistic(parameter1, parameter2, markBit, sourceDBInfo);
                 dataInfo = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, sourceDBInfo[2]);
                 watermark = myMark.initWaterMark(dataInfo, markBit, 2);
                 txtWaterMark.Text = watermark;
             }
             break;
         case 2:
             flag = (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4)
                 && (parameter3 < 1) && (parameter3 > 0) && (parameter4 >= 3.57) && (parameter4 <= 4);
             if (flag == false)
             {
                 MessageBox.Show("零水印参数导入出错!", "操作提示");
             }
             else
             {
                 MarkProducer login = new MarkProducer();
                 markLocate1 = login.Logistic(parameter1, parameter2, markBit, sourceDBInfo);
                 dataInfo = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, sourceDBInfo[2]);
                 watermark = myMark.initWaterMark(dataInfo, markBit, 2);
                 txtWaterMark.Text = myMark.LogisticChaos(parameter3, parameter4, watermark);
             }
             break;
         case 3:
             {
                 flag = true;
                 MarkProducer login = new MarkProducer();
                 markLocate1 = login.SuperChaos(parameter1, parameter2, parameter3, parameter4, markBit, sourceDBInfo);
                 dataInfo = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, sourceDBInfo[2]);
                 watermark = myMark.initWaterMark(dataInfo, markBit,2);
                 txtWaterMark.Text = watermark;
             }
             break;
         default:
             MessageBox.Show("零水印算法导入出错!", "操作提示");
             break;
     }
 }
Example #3
0
        /// <summary>
        /// 零水印算法调度
        /// </summary>
        private void Switch_algorithm1()
        {
            MarkProducer myMark = new MarkProducer();

            switch (algorithm1)
            {
            case 1:
                flag = float.TryParse(txtPara1.Text, out parameter1) && float.TryParse(txtPara2.Text, out parameter2);
                flag = flag && (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4);
                if (flag == false)
                {
                    MessageBox.Show("第二步参数设置出错!", "操作提示");
                    txtPara1.Clear();
                    txtPara2.Clear();
                }
                else
                {
                    MarkProducer login = new MarkProducer();
                    lblInfo.Content = "正在生成零水印...";

                    markLocate1       = login.Logistic(parameter1, parameter2, markBit, DBInfo);
                    dataInfo          = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, DBInfo[2]);
                    watermark         = myMark.initWaterMark(dataInfo, markBit, 1);
                    txtWaterMark.Text = watermark;
                    lblInfo.Content   = "零水印生成完毕...";

                    step2Finish = true;
                }
                break;

            case 2:
                flag = float.TryParse(txtPara1.Text, out parameter1) && float.TryParse(txtPara2.Text, out parameter2) &&
                       float.TryParse(txtPara3.Text, out parameter3) && float.TryParse(txtPara4.Text, out parameter4);
                flag = flag && (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4) &&
                       (parameter3 < 1) && (parameter3 > 0) && (parameter4 >= 3.57) && (parameter4 <= 4);
                if (flag == false)
                {
                    MessageBox.Show("第二步参数设置出错!", "操作提示");
                    txtPara1.Clear();
                    txtPara2.Clear();
                    txtPara3.Clear();
                    txtPara4.Clear();
                }
                else
                {
                    MarkProducer login = new MarkProducer();
                    lblInfo.Content   = "正在生成零水印...";
                    markLocate1       = login.Logistic(parameter1, parameter2, markBit, DBInfo);
                    dataInfo          = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, DBInfo[2]);
                    watermark         = myMark.initWaterMark(dataInfo, markBit, 1);
                    txtWaterMark.Text = myMark.LogisticChaos(parameter3, parameter4, watermark);
                    lblInfo.Content   = "零水印生成完毕!";
                    step2Finish       = true;
                }
                break;

            case 3:
                flag = float.TryParse(txtPara1.Text, out parameter1) && float.TryParse(txtPara2.Text, out parameter2) &&
                       float.TryParse(txtPara3.Text, out parameter3) && float.TryParse(txtPara4.Text, out parameter4);
                if (flag == false)
                {
                    MessageBox.Show("第二步参数设置出错!", "操作提示");
                    txtPara1.Clear();
                    txtPara2.Clear();
                    txtPara3.Clear();
                    txtPara4.Clear();
                }
                else
                {
                    MarkProducer login = new MarkProducer();
                    lblInfo.Content   = "正在生成零水印...";
                    markLocate1       = login.SuperChaos(parameter1, parameter2, parameter3, parameter4, markBit, DBInfo);
                    dataInfo          = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, DBInfo[2]);
                    watermark         = myMark.initWaterMark(dataInfo, markBit, 1);
                    txtWaterMark.Text = watermark;
                    lblInfo.Content   = "零水印生成完毕!";
                    step2Finish       = true;
                }
                break;

            default:
                MessageBox.Show("请您选择第二步算法!", "操作提示");
                break;
            }
        }
Example #4
0
        /// <summary>
        /// 零水印算法调度
        /// </summary>
        private void Switch_algorithm1()
        {
            MarkProducer myMark = new MarkProducer();
            switch (algorithm1)
            {
                case 1:
                    flag = float.TryParse(txtPara1.Text, out parameter1) && float.TryParse(txtPara2.Text, out parameter2);
                    flag = flag && (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4);
                    if (flag == false)
                    {
                        MessageBox.Show("第二步参数设置出错!", "操作提示");
                        txtPara1.Clear();
                        txtPara2.Clear();
                    }
                    else
                    {
                        MarkProducer login = new MarkProducer();
                        lblInfo.Content = "正在生成零水印...";
    
                        markLocate1 = login.Logistic(parameter1, parameter2, markBit, DBInfo);    
                        dataInfo = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, DBInfo[2]);
                        watermark = myMark.initWaterMark(dataInfo, markBit, 1);
                        txtWaterMark.Text = watermark;
                        zeroHamming = login.get_Hamming();
                        lblInfo.Content = "零水印生成完毕...";
                   
                        step2Finish = true;
                    }
                    break;

                case 2:
                    flag = float.TryParse(txtPara1.Text, out parameter1) && float.TryParse(txtPara2.Text, out parameter2)
                        && float.TryParse(txtPara3.Text, out parameter3) && float.TryParse(txtPara4.Text, out parameter4);
                    flag = flag && (parameter1 < 1) && (parameter1 > 0) && (parameter2 >= 3.57) && (parameter2 <= 4)
                        && (parameter3 < 1) && (parameter3 > 0) && (parameter4 >= 3.57) && (parameter4 <= 4);
                    if (flag == false)
                    {
                        MessageBox.Show("第二步参数设置出错!", "操作提示");
                        txtPara1.Clear();
                        txtPara2.Clear();
                        txtPara3.Clear();
                        txtPara4.Clear();
                    }
                    else
                    {
                        MarkProducer login = new MarkProducer();
                        lblInfo.Content = "正在生成零水印...";
                        markLocate1 = login.Logistic(parameter1, parameter2, markBit, DBInfo);
                        dataInfo = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, DBInfo[2]);
                        watermark = myMark.initWaterMark(dataInfo, markBit, 1);
                        txtWaterMark.Text = myMark.LogisticChaos(parameter3, parameter4, watermark);
                        zeroHamming = login.get_Hamming();
                        lblInfo.Content = "零水印生成完毕!";
                        step2Finish = true;
                    }
                    break;
                case 3:
                    flag = float.TryParse(txtPara1.Text, out parameter1) && float.TryParse(txtPara2.Text, out parameter2)
                       && float.TryParse(txtPara3.Text, out parameter3) && float.TryParse(txtPara4.Text, out parameter4);
                    if (flag == false)
                    {
                        MessageBox.Show("第二步参数设置出错!", "操作提示");
                        txtPara1.Clear();
                        txtPara2.Clear();
                        txtPara3.Clear();
                        txtPara4.Clear();
                    }
                    else
                    {
                        MarkProducer login = new MarkProducer();
                        lblInfo.Content = "正在生成零水印...";
                        markLocate1 = login.SuperChaos(parameter1, parameter2, parameter3, parameter4, markBit, DBInfo);
                        dataInfo = myMark.getDataInfo(markBit, markLocate1, TableName, DBType, DBInfo[2]);
                        watermark = myMark.initWaterMark(dataInfo, markBit, 1);
                        txtWaterMark.Text = watermark;
                        zeroHamming = login.get_Hamming();
                        lblInfo.Content = "零水印生成完毕!";
                        step2Finish = true;
                    }
                    break;
                default:
                    MessageBox.Show("请您选择第二步算法!", "操作提示");
                    break;
            }
        }