Пример #1
0
        /// <summary>
        /// ����ģ���߳�
        /// </summary>
        private void TMM(Hashtable TMMSOne,string SavePath)
        {
            try
               {

               HTM2SHORT new_vc_tmm = Long2Short(TMMSOne);

               Hashtable TMMSOne2 = new_vc_tmm.HASH;
               ArrayList Short_DICT1 = new_vc_tmm.Dict1;
               ArrayList Short_DICT2 = new_vc_tmm.Dict2;

               string dataE = "";

               foreach (System.Collections.DictionaryEntry de2 in TMMSOne)
               {
                   dataE = dataE + de2.Key.ToString() + "\r\n";
               }

               //����ģ�幹����
               nSearch.ModelBuild.BuildZXL.ClassModelBuilder myBU = new nSearch.ModelBuild.BuildZXL.ClassModelBuilder();

               string ModelData = "";

               try
               {
                   ModelData = myBU.BuilderModel(TMMSOne2);

                   ModelData = Short2Long(ModelData, Short_DICT1, Short_DICT2);  //��ԭѹ��������

               }
               catch
               {
                   nSearch.DebugShow.ClassDebugShow.WriteLineF("--> ERROR �ų�����ģ��");
                //   nSearch.DebugShow.ClassDebugShow.WriteLineF;
                   return;
               }

               int nn = myBU.inStrNum(ModelData, "*");

               //ģ�潨������ ���������ݲ������ģ�洴������ ���迼��
               if (ModelData.Length < 150 | nn < 4)
               {
                   nSearch.DebugShow.ClassDebugShow.WriteLineF("--> �ų�����ģ��");
                   return;
               }

               ArrayList txtDat = EditOneModelTag(ModelData);

               ArrayList neWW = (ArrayList)txtDat.Clone();

               //*************************************************************************************
               //  ƥ��ģ��
               //*************************************************************************************
               // ƥ��ģ��  ����ȫ��ƥ��ģ��
               string[] pipeiEndData = new string[neWW.Count];  //ƥ��õ���ƥ�����б�����
               for (int i = 0; i < neWW.Count; i++)
               {
                   pipeiEndData[i] = "";
               }
               foreach (System.Collections.DictionaryEntry de2 in TMMSOne)
               {
                   //�����˲���
                   nSearch.ClassLibraryStruct.ClassUserModel m = new nSearch.ClassLibraryStruct.ClassUserModel();
                   //ѹ�����ģ��
                   m.TestModeL("", "", "", "", "", "", ModelData, "","","");
                   nSearch.ClassLibraryStruct.auto2dat k = m.getTagAndData(de2.Value.ToString());
                   Hashtable p = m.modelOneList;
                   foreach (System.Collections.DictionaryEntry de in p)
                   {
                       int pi = (int)de.Key;
                       pipeiEndData[pi] = pipeiEndData[pi] + de.Value.ToString().Trim();
                   }
               }

               string dataA = "";//�����õ�����

               string dataB = "";//����õ�����

               string TagTmp = "����"; //��¼��1���б�ʾ�� ����

               for (int i = 0; i < neWW.Count; i++)
               {
                   if (pipeiEndData[i].Length > 0)
                   {
                       dataA = dataA + neWW[i].ToString() + ":" + "<TAGDATA INDEX=" + i.ToString() + "/>" + "\r\n";

                       if (neWW[i].ToString().Length > 1)
                       {
                           if (neWW[i].ToString().IndexOf(' ') == -1 & neWW[i].ToString().Length < 13)
                           {
                               dataB = dataB + "<" + neWW[i].ToString() + ">" + "<TAGDATA INDEX=" + i.ToString() + "/>" + "</" + neWW[i].ToString() + ">" + "\r\n";
                               TagTmp = neWW[i].ToString();
                           }
                           else
                           {
                               string[] xrr = neWW[i].ToString().Split(' ');
                               string TagII = xrr[xrr.Length - 1];
                               dataB = dataB + "<" + TagII + ">" + "<TAGDATA INDEX=" + i.ToString() + "/>" + "</" + TagII + ">" + "\r\n";
                               TagTmp = TagII;
                           }
                       }
                       else
                       {
                           //��ʾ������ǰ�� �޿���ʹ�õ����Ա�ʾ ��Ѵ� ȡ�������ݺϲ���ǰ��  <XX><TAGDATA INDEX=1></XX> <XX><TAGDATA INDEX=1><TAGDATA INDEX=2></XX>

                           //1 ȡ�������� <TAGDATA INDEX=1>
                           if (TagTmp.Length > 0)
                           {
                               dataB = dataB + "<" + TagTmp + ">" + "<TAGDATA INDEX=" + i.ToString() + "/>" + "</" + TagTmp + ">" + "\r\n";
                           }
                       }
                   }
               }

               string x = SavePath;

               nSearch.ClassLibraryStruct.auto2dat v = new nSearch.ClassLibraryStruct.auto2dat();

               putFileData(x + ".a", "<TAGDATA INDEX=1/>");// ����A

               putFileData(x + ".b", dataB);// ���B

               putFileData(x + ".c", dataA);// ��Ҫ��ʾC

               putFileData(x + ".d", dataA);// ������ʾD

               putFileData(x + ".e", dataA);// �����õ�����E

               putFileData(x + ".f", dataE);// ��������б�F

               putFileData(x + ".h", ModelData);// �Զ����� ������H

               putFileData(x + ".t", "HTM");// �����ı�������

               putFileData(x + ".m", "WEB");// �����

               putFileData(x + ".a1", "<TAGDATA INDEX=1/>");// ���һ
               putFileData(x + ".a2", "<TAGDATA INDEX=1/>");// ����

               nSearch.DebugShow.ClassDebugShow.WriteLineF("-ģ�潨���ɹ�->");

               }
               catch
               {
               nSearch.DebugShow.ClassDebugShow.WriteLineF("-ģ�潨��ʧ��->");
               }
        }
Пример #2
0
        private void button3_Click_1(object sender, EventArgs e)
        {
            nSearch.ClassLibraryHTML.ClassHTML dd = new nSearch.ClassLibraryHTML.ClassHTML();

            //�����˲���
            nSearch.ClassLibraryStruct.ClassUserModel m = new nSearch.ClassLibraryStruct.ClassUserModel();

            //ѹ�����ģ��
            m.TestModeL(textBox_a.Text, textBox_b.Text, textBox_c.Text, textBox_d.Text, textBox_e.Text, textBox_t.Text, textBox_h.Text, "", textBox_TA1.Text , textBox_TA2.Text );

            nSearch.ClassLibraryStruct.auto2dat k = m.getTagAndData(textBox7.Text);

            Hashtable p = m.modelOneList;

            listBox2.Items.Clear();

            foreach (System.Collections.DictionaryEntry de in p)
            {

                listBox2.Items.Add(de.Key.ToString() + '\t' + de.Value.ToString());
            }

            textBox_a1.Text = k.A;
            textBox_b1.Text = k.B;
            textBox_e1.Text = dd.GetClearCode(   k.E,true);

            textBox_c1.Text = k.C;

            textBox_d1.Text = k.D;

            textBox_TAc1.Text = k.A_TYPE_1;
            textBox_TAc2.Text = k.A_TYPE_2;
        }