Esempio n. 1
0
        private void comBoxLoadTaobao_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.InitialDirectory = Directory.GetCurrentDirectory();
            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            comBoxLoadTaobao.Text = dlg.SafeFileName;

            //--------------------------------------------
            string       sLine     = "";
            StreamReader objReader = new StreamReader(dlg.FileName);

            listLtTaobao.Clear();
            while (sLine != null)
            {
                sLine = objReader.ReadLine();
                if (sLine != null && !sLine.Equals(string.Empty))
                {
                    LtItem item = new LtItem();
                    if (item.fromString(sLine) < 0)
                    {
                        MessageBox.Show("Wrong data: " + sLine);
                        return;
                    }
                    listLtTaobao.Add(item);
                }
            }
            objReader.Close();
            comBoxExistData.SelectedIndex = 1;
        }
Esempio n. 2
0
        private void comBoxLoadTaobaoFileter_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.InitialDirectory = Directory.GetCurrentDirectory();
            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            comBoxLoadTaobaoFileter.Text = dlg.SafeFileName;

            //--------------------------------------------
            string       sLine     = "";
            StreamReader objReader = new StreamReader(dlg.FileName);

            listLtTaobaoFilter.Clear();
            while (sLine != null)
            {
                sLine = objReader.ReadLine();
                if (sLine != null && !sLine.Equals(string.Empty))
                {
                    LtItem item = new LtItem();
                    if (item.fromString(sLine) < 0)
                    {
                        MessageBox.Show("Wrong data: " + sLine);
                        return;
                    }
                    listLtTaobaoFilter.Add(item);
                }
            }
            objReader.Close();


            LtCounter   count  = new LtCounter();
            List <long> allRed = new List <long>();
            List <long> red5s  = new List <long>();

            foreach (LtItem item in listLtTaobaoFilter)
            {
                if (count.getItem(item.red, allRed) == 0)
                {
                    foreach (long map in allRed)
                    {
                        red5s.Clear();
                        long mapTmp = map & 0x1FFFFFFFF;
                        if (!mapTaob6.ContainsKey(mapTmp))
                        {
                            mapTaob6.Add(mapTmp, null);
                        }

                        count.get_6_to_5(mapTmp, red5s);
                        for (int i = 0; i < 6; ++i)
                        {
                            if (!mapTaob5.ContainsKey(red5s[i]))
                            {
                                mapTaob5.Add(red5s[i], null);
                            }
                        }
                    }
                }
                allRed.Clear();
            }
        }