Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to implement windows application with OPEN FILE DIALOG & SAVE FILE DIALOG

How to implement windows application with OPEN FILE DIALOG & SAVE FILE DIALOG

Scheduled Pinned Locked Moved C#
csharphelptutorial
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nareshss
    wrote on last edited by
    #1

    Hi Every one .... I want to develope a "windows application" with openfile dailog and save filedialog in c# Plz help me ... Iam new to dotnet ... help me with examples Thanks inadvance naresh.s.s

    C M S 3 Replies Last reply
    0
    • N nareshss

      Hi Every one .... I want to develope a "windows application" with openfile dailog and save filedialog in c# Plz help me ... Iam new to dotnet ... help me with examples Thanks inadvance naresh.s.s

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      The classes are OpenFileDialog and SaveFileDialog.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      N 1 Reply Last reply
      0
      • N nareshss

        Hi Every one .... I want to develope a "windows application" with openfile dailog and save filedialog in c# Plz help me ... Iam new to dotnet ... help me with examples Thanks inadvance naresh.s.s

        M Offline
        M Offline
        M J Jaya Chitra
        wrote on last edited by
        #3

        1. Create a object for the dialog control (OpenFileDialog or SaveFileDialog)or use the controls 2. Then you open the dialog with ShowDialog() method 3. You can use Filter property to set the patterns to be displaye For e.g (Text Files|*.txt|All Files|*.*"

        Best Regards, M. J. Jaya Chitra

        N 1 Reply Last reply
        0
        • N nareshss

          Hi Every one .... I want to develope a "windows application" with openfile dailog and save filedialog in c# Plz help me ... Iam new to dotnet ... help me with examples Thanks inadvance naresh.s.s

          S Offline
          S Offline
          sujithkumarsl
          wrote on last edited by
          #4

          you can get all those this from .net itself. make use of the toolbox

          My small attempt...

          1 Reply Last reply
          0
          • M M J Jaya Chitra

            1. Create a object for the dialog control (OpenFileDialog or SaveFileDialog)or use the controls 2. Then you open the dialog with ShowDialog() method 3. You can use Filter property to set the patterns to be displaye For e.g (Text Files|*.txt|All Files|*.*"

            Best Regards, M. J. Jaya Chitra

            N Offline
            N Offline
            nareshss
            wrote on last edited by
            #5

            sssss Ive done upto open dialog it will gies the path ... but for the sae dialog am not getting the path there .... and i cant able to save the file to desired forder ... my code is ....... For Opendailog OpenFileDialog fdlg = new OpenFileDialog(); SaveFileDialog dlg = new SaveFileDialog(); fdlg.Title = "Browse any file from here "; fdlg.InitialDirectory = @"c:/Resume"; fdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*"; fdlg.FilterIndex = 2; fdlg.RestoreDirectory = true; if (fdlg.ShowDialog() == DialogResult.OK) { textBox1.Text = fdlg.FileName; } for Savedailog saveFileDialog1.Title = "Specify Destination Filename"; saveFileDialog1.Filter = "Text Files|*.txt"; saveFileDialog1.OverwritePrompt = true; saveFileDialog1.FilterIndex = 1; if (saveFileDialog1.ShowDialog() != DialogResult.Cancel) { textBox1.Text = saveFileDialog1.FileName; } this is wat ive done till now ... but iam not gettign the path there at textbox1 when iam going to save the file ... Plz help me ..... bye naresh.s.s

            M 1 Reply Last reply
            0
            • C Christian Graus

              The classes are OpenFileDialog and SaveFileDialog.

              Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

              N Offline
              N Offline
              nareshss
              wrote on last edited by
              #6

              sssss Ive done upto open dialog it will gies the path ... but for the sae dialog am not getting the path there .... and i cant able to save the file to desired forder ... my code is ....... For Opendailog OpenFileDialog fdlg = new OpenFileDialog(); SaveFileDialog dlg = new SaveFileDialog(); fdlg.Title = "Browse any file from here "; fdlg.InitialDirectory = @"c:/Resume"; fdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*"; fdlg.FilterIndex = 2; fdlg.RestoreDirectory = true; if (fdlg.ShowDialog() == DialogResult.OK) { textBox1.Text = fdlg.FileName; } for Savedailog saveFileDialog1.Title = "Specify Destination Filename"; saveFileDialog1.Filter = "Text Files|*.txt"; saveFileDialog1.OverwritePrompt = true; saveFileDialog1.FilterIndex = 1; if (saveFileDialog1.ShowDialog() != DialogResult.Cancel) { textBox1.Text = saveFileDialog1.FileName; } this is wat ive done till now ... but iam not gettign the path there at textbox1 when iam going to save the file ... Plz help me ..... bye naresh.s.s

              1 Reply Last reply
              0
              • N nareshss

                sssss Ive done upto open dialog it will gies the path ... but for the sae dialog am not getting the path there .... and i cant able to save the file to desired forder ... my code is ....... For Opendailog OpenFileDialog fdlg = new OpenFileDialog(); SaveFileDialog dlg = new SaveFileDialog(); fdlg.Title = "Browse any file from here "; fdlg.InitialDirectory = @"c:/Resume"; fdlg.Filter = "All files (*.*)|*.*|All files (*.*)|*.*"; fdlg.FilterIndex = 2; fdlg.RestoreDirectory = true; if (fdlg.ShowDialog() == DialogResult.OK) { textBox1.Text = fdlg.FileName; } for Savedailog saveFileDialog1.Title = "Specify Destination Filename"; saveFileDialog1.Filter = "Text Files|*.txt"; saveFileDialog1.OverwritePrompt = true; saveFileDialog1.FilterIndex = 1; if (saveFileDialog1.ShowDialog() != DialogResult.Cancel) { textBox1.Text = saveFileDialog1.FileName; } this is wat ive done till now ... but iam not gettign the path there at textbox1 when iam going to save the file ... Plz help me ..... bye naresh.s.s

                M Offline
                M Offline
                Muhammad Qasim Pasta
                wrote on last edited by
                #7

                can you tell then what does it show?? One thing I found in your code is that... your code for declaring SaveDialog object is SaveFileDialog dlg = new SaveFileDialog(); where you are using .. saveFileDialog1.Title = "Specify Destination Filename"; saveFileDialog1.Filter = "Text Files|*.txt"; saveFileDialog1.OverwritePrompt = true; saveFileDialog1.FilterIndex = 1; if (saveFileDialog1.ShowDialog() != DialogResult.Cancel) { textBox1.Text = saveFileDialog1.FileName; } .... it seems you are also using another Object of SaveFileDialog, that you added in your form from toolbox (as naming convention suggest)...

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups