Exemplo n.º 1
0
        public static bool show(out string filename)
        {
            FrmFileNameDialog fld = new FrmFileNameDialog();
            DialogResult      dr  = fld.ShowDialog();

            filename = fld.textBox1.Text;
            return(dr == DialogResult.OK);
        }
Exemplo n.º 2
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("笔记保存成功。(刷新笔记查看)");
            }
        }
Exemplo n.º 3
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("系统找不到指定的文件");
                }
            }
        }