Beispiel #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();
        }
Beispiel #2
0
        private void ToTxt(string src, string dst)
        {
            if (!File.Exists(src))
            {
                return;
            }
            Ebk3Open ebk = new Ebk3Open();

            ebk.Open(src);
            FileStream fs = new FileStream(dst + "\\" + Path.GetFileNameWithoutExtension(src) + ".txt", FileMode.Create);

            for (int i = 0; i < ebk.GetChapterCount(); i++)
            {
                byte[] buff = Encoding.UTF8.GetBytes(ebk.EBK3GetChapter(i) + "\n");
                fs.Write(buff, 0, buff.Length);
            }
            fs.Close();
            ebk.EBK3Close();
        }