Пример #1
0
        public void onNoteTextArrival(string text)
        {
            string outname  = "";
            string notePath = Path.Combine(Program.openingPath, "notes");

            if (!Directory.Exists(notePath))
            {
                Directory.CreateDirectory(notePath);
            }
            if (FrmFileNameDialog.show(out outname))
            {
                File.WriteAllText(Path.Combine(notePath, outname + ".txt"), text);
                MessageBox.Show("笔记保存成功。(刷新笔记查看)");
            }
        }
Пример #2
0
        public void onNoteImageArrival(string url)
        {
            string path     = url.Replace("http://epub.zyfdroid.com/book", Program.openingPath).Replace("/", "\\");
            string outname  = "";
            string notePath = Path.Combine(Program.openingPath, "notes");

            if (!Directory.Exists(notePath))
            {
                Directory.CreateDirectory(notePath);
            }
            if (FrmFileNameDialog.show(out outname))
            {
                if (File.Exists(path))
                {
                    File.Copy(path, Path.Combine(notePath, outname + Path.GetExtension(path)), true);
                    MessageBox.Show("笔记保存成功。(刷新笔记查看)");
                }
                else
                {
                    MessageBox.Show("系统找不到指定的文件");
                }
            }
        }