can someone help.. i can see the file when i click the save button on my folder.. can you help me...

{
            SaveFileDialog dialog = new SaveFileDialog();
            saveFileDialog1.ShowDialog();
            saveFileDialog1.InitialDirectory = @"C:\sample";
           
            saveFileDialog1.Title = "Browse a file";
            saveFileDialog1.DefaultExt = "txt";
            saveFileDialog1.Filter = "Text Files (*.txt)|*.txt| PDF File (*.pdf)|*.pdf";
            saveFileDialog1.FilterIndex = 2;
            saveFileDialog1.RestoreDirectory = true;
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {

                textBox1.Text = saveFileDialog1.FileName;
               
            }
            
        }

there is no operation in your code to save a file to a folder.

string str = saveFileDialog1.FullName;
str will have the complete path of your selected file, you will have to use File.Copy() to copy the file to your destination folder.

@arunkumars, thank you for your help. now it clears to my minds my problem.. once again thank you.. Happy Coding

@cyberdaemon :
you are welcome, could you please add a reputaion point to the thread.
also mark the thread as solved.

Happy coding.. :)

Edited 5 Years Ago by arunkumars: n/a

This question has already been answered. Start a new discussion instead.