Пример #1
0
        private void ToUmd(string src, string dst)
        {
            if (!File.Exists(src))
            {
                return;
            }
            Ebk3Open     ebk         = new Ebk3Open();
            BookInfo     info        = ebk.Open(src);
            UMD_GENEGINE umd         = new UMD_GENEGINE();
            ArrayList    Chapters    = new ArrayList();
            ArrayList    ChapterStrs = new ArrayList();

            for (int i = 0; i < ebk.GetChapterCount(); i++)
            {
                Chapters.Add(ebk.EBK3GetChapterList()[i].chapter_name_data8);
                ChapterStrs.Add(ebk.EBK3GetChapter(i));
            }
            string aResult;

            umd.Initialize(info.BookName, info.Author == "" ? "未知" : info.Author, DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), DateTime.Now.Day.ToString(), "", "", "tisn", "", 0, dst, ref Chapters, ref ChapterStrs, out aResult);
            ProgressBar pb = new ProgressBar();

            umd.Make(ref pb, out aResult);
            ebk.EBK3Close();
        }
Пример #2
0
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            int index = lvM.SelectedIndex;

            if (index == -1)
            {
                return;
            }
            String name = (String)lvM.Items.GetItemAt(index);

            mReader.Close();
            mCmd.CommandText = "SELECT * FROM `CATALOG_TABLE`";// WHERE `novel_name` =  `" + name + "`";
            mReader          = mCmd.ExecuteReader();
            mReader.Read();
            String       book_id = mReader.GetString(0);
            UCNovel      ucn     = new UCNovel(tbFileName.Text + @"\" + book_id + @"\" + book_id + ".ucnovel");
            UMD_GENEGINE umd     = new UMD_GENEGINE();
            String       title   = mReader.GetString(1);
            String       author  = mReader.GetString(2);
            String       tName   = mReader.GetString(3);

            mReader.Close();
            mCmd.CommandText = "SELECT * FROM '" + tName + "'";
            mReader          = mCmd.ExecuteReader();
            ArrayList Chapter = new ArrayList();
            ArrayList Chapstr = new ArrayList();

            while (mReader.Read())
            {
                Chapter.Add(mReader.GetString(2));
                Chapstr.Add(ucn.GetContent(mReader.GetString(9)));
            }
            String result;

            umd.Initialize(title, author, "2015", "01", "01", "", "", "", @"C:\Users\Administrator\Desktop\1", 0, "C:\\", ref Chapter, ref Chapstr, out result);
            umd.Make(ref progressBar1, out result);
            ucn.Close();
        }