Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to Save the file on application folder?

Posted on 2006-07-24
3
214 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
ID: 17167532
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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 …

856 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