Ejemplo n.º 1
0
        private void stripGuadar_OnClick(object sender, EventArgs e)
        {
            ArchText texto = new ArchText();

            if (this.path != null)
            {
                texto.Guardar(this.path, this.richTextBox1.Text);
            }
            else
            {
                this.GuardarComo();
            }
        }
Ejemplo n.º 2
0
        private void GuardarComo()
        {
            SaveFileDialog guardar = new SaveFileDialog();

            guardar.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            guardar.Filter           = "txt files (*.txt)|*.txt";

            if (guardar.ShowDialog() == DialogResult.OK)
            {
                this.path = guardar.FileName;

                ArchText texto = new ArchText();

                texto.Guardar(this.path, this.richTextBox1.Text);
            }
        }
Ejemplo n.º 3
0
        private void stripAbrir_OnClick(object sender, EventArgs e)
        {
            OpenFileDialog abrir = new OpenFileDialog();

            abrir.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            abrir.Filter           = "txt files (*.txt)|*.txt";

            if (abrir.ShowDialog() == DialogResult.OK)
            {
                this.path = abrir.FileName;

                ArchText texto = new ArchText();

                this.richTextBox1.Text = texto.Leer(this.path);
            }
        }