1
Answer

Get the path in the required form

Ask a question
Dorababu Meka

Dorababu Meka

14y
1.9k
1
Hi all i have written a code to save the file in a selected folder by setting the path

This is my  code on main form


 private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
           /Stream myStream = null;
            FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog();


            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    String s = folderBrowserDialog1.SelectedPath;
                  
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
                }
            }

        }

Now i am having a separate form form on that form i am having some text boxes where i can fill some information and save it. When i click on save the file should be saved to the target folder he specified previously(Sample above code) any idea please

Answers (1)