Hi,
I am working with c#.net. In my application i want to give facility to
user to add image. I use open dialog box to select image, it will work
properly i.e on button click open dialog is open select any image and
display in picture box.
So i want to store that selected image into specified folder and that path stored into database, for furhter retrivation.
Please guide me to overcome from that problem
Loading

Nir BarPosted Oct 1, 2009, 5:36 AM
To copy a file:
System.IO.File.Copy( sourceFullFileName, targetFullFileName); // Both arguments are Strings
If you need to create a directory to place the files in:
System.IO.Directory.CreateDirectory( directoryName); // Will create all directories and subdirectories as required
Please mark this post as an answer if it helps you
Nir
Nagesh RPosted Oct 1, 2009, 6:15 AM
string path = string.Format(@"C:\Documents and Settings\{0}\My Documents\My Pictures", Environment.UserName);
here the user name is corresponding logged in person user name..Roei BarPosted Oct 1, 2009, 6:02 AM
always make sure that DirecTory.Exists is False before trying to create a new one
you can use this code for assistance:
http://www.redmondpie.com/inserting-in-and-retrieving-image-from-sql-server-database-using-c/
Vikas AhlawatPosted Oct 1, 2009, 5:01 AM
Nir BarPosted Oct 1, 2009, 3:50 AM
System.IO.File class can be used to copy files
System.IO.Directory can be used to create directory
Please mark this post as an answer if it helps you
Nir