Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Iam devloping a HR Software using C# and sql server 2005. I have to store employee images on a specific folder of the server not on the database and then read it from the specific folder say "C:\EmpImages". I will be grateful If anyone can help me. Thanks in advance.
Posted
Updated 24-Jul-11 19:33pm
v2
Comments
walterhevedeich 25-Jul-11 1:34am    
What's your problem here? What kind of help do you need?

Try following code to access image from a any location on your system:

private void pictureBox1_MouseClick(object sender, MouseEventArgs e)
     {
         OpenFileDialog ofDlg = new OpenFileDialog();
         ofDlg.Filter = "Image files (.jpg, .jpeg, .bmp,  .gif)|*.jpg;*.jpeg;*.bmp;*.gif";
         if (ofDlg.ShowDialog() == DialogResult.OK)
         {
             imageFileName = ofDlg.FileName;         // This imagepath shall be used to store in members table
             pictureBox1.Image = Image.FromFile(imageFileName);
         }
     }


Hope this will help you.
 
Share this answer
 
Comments
Faijus Salehin Ferdous 26-Jul-11 7:33am    
Thanks
Hi,
save the images using a specific id,when the users id is matching with the imagename pickout that from the drive and display.



regards.,
shefeek
 
Share this answer
 
Comments
Faijus Salehin Ferdous 26-Jul-11 7:32am    
Thanks
It might help you,

Image.Save[^]
Image.FromFile[^]

:)
 
Share this answer
 
Comments
Faijus Salehin Ferdous 26-Jul-11 7:32am    
Thanks

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