Click here to Skip to main content
15,895,370 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello
I have a problem... i am developing a software where i need to use images.
and i want to copy all images to resource or images folder of solution(Project) through programming.And then I want to save the new Path into Database.
So pleas...pleas Help Me
Posted
Updated 21-Mar-11 21:14pm
v2

No, no you don't want to do that.

I'm not sure what you do actually want to do - I have no idea of your application - but you really don't want you app to modify itself when it is running. And adding items to the solution folders is effectively that.

What happens when you release the program? Where is the solution folder then? Are you going to release the source code (and a copy of VS) with each installation?

Instead, keep these images in your ApplicationData folder, or (better still) put them directly into your database.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 22-Mar-11 10:59am    
My 5. I'm almost sure OP does not understand what build of the project does.
--SA
You need to know the path of the folder before you can copy the images across. Then you can just use File.Copy(sourceFileName, destFileName) to transfer the images. Personally I like to use the Application Settings file to hold things such as resource paths. That way you can just set up a resource folder at setup and save the path into the Settings file. To save the path into a database is the same as saving any string, varchar field using ADO.Net
Hope this helps.
 
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