Click here to Skip to main content
15,908,115 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to give Address of Folder in which I can upload my document .
this folder automatically generated when deploy the application or make the exe.
I know the url of the folder change when make the exe of the application . How to manage that in my application . So that my document can upload/Save in client machine when he installed the exe.

thnaks
Posted

Don't try to store data files in the application folder - it is not a good idea and may be prevented by security policies anyway. Instead, store it in the location specified by Environment.SpecialFolder[^] - either CommonApplicationData or LocalApplicationData is fine.

C#
Console.WriteLine("GetFolderPath: {0}",                  Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData));
You can then apply your application name or GUID and use that as a folder to store your data. It may change between machines, but it will be constant on a specific machine.
 
Share this answer
 
If you are developing a Desktop application, then a Setup project can be created in which a folder can be specified, which will be created on the client machine, when your application is installed on that machine.
Creating a Setup project in Visual Studio is explained in this Code Project article.
Visual Studio Windows Application Setup Project[^]
and in this article
http://www.dreamincode.net/forums/topic/58021-deploying-a-c%23-application-visual-studio-setup-project/[^]
Now while running the program to access a file created in the program's installation folder, then Application.StartupPath property can be used, which is explained here
http://msdn.microsoft.com/en-us/library/system.windows.forms.application.startuppath.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900