C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2722
Number of posts: 5749

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
File reading/writing Posted by ITA on 23 Jun 2004 at 8:42 AM
I have created an application which uses XML files to populate a DataSet and then a DataGrid control. I've created a class which performs data reading and writing for me.

I want to let the user choose where to save the XML files. I have a vague idea of how to do this but I am unsure how to record the location of where the user has saved the files so that I can read from them again. Does anyone have any ideas as to what I could do? Also how do I bring up the dialog which allows the user to save the files?

Many thanks.

ITA


Report
Re: File reading/writing Posted by koticse on 24 Jun 2004 at 12:56 PM
Hi,

You can use OpenFileDialog and SaveFileDialog controls to Open and Save the Files respectively. You can also set the Filters for what ever files you want to Open.

I hope this will help you solve your problem.

OpenFileDailog classes object is opFileDialog then

opFileDialog.ShowDialog() will display the dialog box to the user.
opFileDialog.FileName give the name of the file you have selected for opening.

similarly the case with the SaveFileDialog.

All the best




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.