Exemplo n.º 1
0
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            openFileDialog1.ShowDialog();
            txtPath.Text = openFileDialog1.FileName;
            digiozFileTrans loFileTrans = new digiozFileTrans();
            string lsError = string.Empty;

            txtEdit.Text = loFileTrans.GetFileContents(txtPath.Text.Trim(), ref lsError);

            if (lsError.Length > 0)
            {
                MessageBox.Show(lsError);
            }
        }
Exemplo n.º 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txtPath.Text.Length > 0 && System.IO.File.Exists(txtPath.Text.Trim()))
            {
                string lsError = string.Empty;
                digiozFileTrans loFileTrans = new digiozFileTrans();
                loFileTrans.SaveTextToFile(txtEdit.Text, txtPath.Text.Trim(), ref lsError);

                if (lsError.Length > 0)
                {
                    MessageBox.Show(lsError);
                }
                else
                {
                    MessageBox.Show("Changes Saved Successfully");
                }
            }
            else
            {
                MessageBox.Show("Unable to Read the file at the path specified");
            }
        }