/// <summary>
        /// 双重水印算法调度
        /// </summary>
        private void Switch_algorithm2()
        {
            MarkProducer myMark = new MarkProducer();

            switch (algorithm2)
            {

                case 1:
                    flag = flag && float.TryParse(txtPara5.Text, out parameter5) && float.TryParse(txtPara6.Text, out parameter6);
                    flag = flag && (parameter5 < 1) && (parameter5 > 0) && (parameter6 >= 3.57) && (parameter6 <= 4);
                    if (flag == false)
                    {
                        MessageBox.Show("第三步参数设置出错!", "操作提示");
                        txtPara5.Clear();
                        txtPara6.Clear();
                    }
                    else
                    {
                            picLen = bufPic.Length;
                            picOffset1 = bufPic[2];
                            picOffset2 = bufPic[3];
                            MarkProducer login = new MarkProducer();
                            lblInfo.Content = "正在生成图像水印...";
                            
                            markLocate2 = login.Logistic(parameter5, parameter6, (picLen - 62) * 8, picDBInfo);
                            myMark.PicMark(picLen, bufPic, markLocate2, TableName, DBType, picDBInfo[2]);
                            lblInfo.Content = "图像水印生成完毕!";
                               
                            step3Finish = true;
                    }
                    break;
                case 2:
                    flag = flag && float.TryParse(txtPara5.Text, out parameter5) && float.TryParse(txtPara6.Text, out parameter6)
                        && float.TryParse(txtPara7.Text, out parameter7) ;
                    flag = flag && (parameter5 <= 200) && (parameter5 >= 0) 
                        && (parameter6 < 1) && (parameter6 > 0) && (parameter7 >= 3.57) && (parameter7 <= 4);
                    if (flag == false)
                    {
                        MessageBox.Show("第三步参数设置出错!", "操作提示");
                        txtPara5.Clear();
                        txtPara6.Clear();
                        txtPara7.Clear();
                    }
                    else
                    {
                            picLen = bufPic.Length;
                            picOffset1 = bufPic[2];
                            picOffset2 = bufPic[3];
                            MarkProducer login = new MarkProducer();
                            lblInfo.Content = "正在生成图像水印...";

                            markLocate2 = login.Logistic(parameter6, parameter7, (picLen - 62) * 8, picDBInfo);
                            bufPic = login.BitExPicMark((int)parameter5, parameter1, parameter2, (picX - 1) + (picY - 1) + 8, bufPic, 1);
                            picHamming = login.get_Hamming();
                            myMark.PicMark(picLen, bufPic, markLocate2, TableName, DBType, picDBInfo[2]);
                            lblInfo.Content = "图像水印生成完毕!";
                               
                            step3Finish = true;
                    }
                    break;
                default:
                    MessageBox.Show("请您选择第三步算法!", "操作提示");
                    break;
            }
        }
        /// <summary>
        /// 双重水印算法调度
        /// </summary>
        private void Switch_algorithm2()
        {
            MarkProducer myMark = new MarkProducer();

            switch (algorithm2)
            {
            case 1:
                flag = flag && float.TryParse(txtPara5.Text, out parameter5) && float.TryParse(txtPara6.Text, out parameter6);
                flag = flag && (parameter5 < 1) && (parameter5 > 0) && (parameter6 >= 3.57) && (parameter6 <= 4);
                if (flag == false)
                {
                    MessageBox.Show("第三步参数设置出错!", "操作提示");
                    txtPara5.Clear();
                    txtPara6.Clear();
                }
                else
                {
                    picLen     = bufPic.Length;
                    picOffset1 = bufPic[2];
                    picOffset2 = bufPic[3];
                    MarkProducer login = new MarkProducer();
                    lblInfo.Content = "正在生成图像水印...";

                    markLocate2 = login.Logistic(parameter5, parameter6, (picLen - 62) * 8, picDBInfo);
                    myMark.PicMark(picLen, bufPic, markLocate2, TableName, DBType, picDBInfo[2]);
                    lblInfo.Content = "图像水印生成完毕!";

                    step3Finish = true;
                }
                break;

            case 2:
                flag = flag && float.TryParse(txtPara5.Text, out parameter5) && float.TryParse(txtPara6.Text, out parameter6) &&
                       float.TryParse(txtPara7.Text, out parameter7);
                flag = flag && (parameter5 <= 200) && (parameter5 >= 0) &&
                       (parameter6 < 1) && (parameter6 > 0) && (parameter7 >= 3.57) && (parameter7 <= 4);
                if (flag == false)
                {
                    MessageBox.Show("第三步参数设置出错!", "操作提示");
                    txtPara5.Clear();
                    txtPara6.Clear();
                    txtPara7.Clear();
                }
                else
                {
                    picLen     = bufPic.Length;
                    picOffset1 = bufPic[2];
                    picOffset2 = bufPic[3];
                    MarkProducer login = new MarkProducer();
                    lblInfo.Content = "正在生成图像水印...";

                    markLocate2 = login.Logistic(parameter6, parameter7, (picLen - 62) * 8, picDBInfo);
                    bufPic      = login.BitExPicMark((int)parameter5, parameter1, parameter2, (picX - 1) + (picY - 1) + 8, bufPic, 1);
                    picHamming  = login.get_Hamming();
                    myMark.PicMark(picLen, bufPic, markLocate2, TableName, DBType, picDBInfo[2]);
                    lblInfo.Content = "图像水印生成完毕!";

                    step3Finish = true;
                }
                break;

            default:
                MessageBox.Show("请您选择第三步算法!", "操作提示");
                break;
            }
        }
        /// <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;
            }
        }
        /// <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;
            }
        }