Solved

How to Save the file on application folder?

Posted on 2006-07-24
3
211 Views
Last Modified: 2010-04-16
Hi Dear Friends,

I am creating one Windows Application in C# using VS.NET 2005.
I have one textbox, a Browse Button & a Save button on my windows form.

When user clicks on browse button, the file name will displayd in the Textbox.
After user clicks on the Save button, then I want to save the file to my application's "Images" folder.

Please, reply if you have the soluton or any trick to do this.

Thanks in advance...

From
-spdude
0
Comment
Question by:spdude
3 Comments
 
LVL 35

Accepted Solution

by:
YZlat earned 400 total points
Comment Utility
string apppath;
           
            // get your personal application folder
            apppath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData);

            // create application path
            apppath = Path.Combine( apppath, "Images" );

            // create path if it doesn't exist
            if (!Directory.Exists(apppath))
                Directory.CreateDirectory(apppath);

            // append configuration's filename to path string
            apppath = Path.Combine( apppath, "yourfilename.extension" );
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now