Solved

How to Save the file on application folder?

Posted on 2006-07-24
3
217 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
[X]
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
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
T-SQL:  Sigh---Boy, this is fun.... 12 73
Getting Variable not defined error in Python 1 74
Java ArrayList and if statement 2 52
Code planning methods/tools? 5 51
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

738 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