0

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;
               
            }
            
        }
2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by arunkumars
0

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.

0

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

0

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

Happy coding.. :)

Edited by arunkumars: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.