469,306 Members | 2,531 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

C# Open file dialog and saving

I don t knw if im in the right place but please i need help

u need to make an open file dialog so that the user can browse an image then i have to save the image.

I already did the openfiledialog, and i am displaying it in apicture box. but i just cannot understand how to save it in a particular path. please help me!
May 18 '07 #1
3 18331
u can use the asp.net FileUpload contol....
May 18 '07 #2
shidec
26
u can use Image.Save or just copy file from original location to destination.
Expand|Select|Wrap|Line Numbers
  1.  
  2. private void btnOpenPicture_Click(object sender, EventArgs e)
  3. {
  4.     if (openDialog.ShowDialog() == DialogResult.OK)
  5.     {
  6.         pictureBox1.Load(openDialog.FileName);
  7.     }
  8. }
  9.  
  10. private void btnSavePicture_Click(object sender, EventArgs e)
  11. {
  12.     if (saveDialog.ShowDialog() == DialogResult.OK)
  13.     {
  14.         pictureBox1.Image.Save(saveDialog.FileName);
  15.     }
  16. }
  17.  
May 18 '07 #3
thanks :)

i used File.Copy(source path, destination path ) and it worked perfectly :)
May 18 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Bernavich2004 | last post: by
reply views Thread by ungvichian | last post: by
2 posts views Thread by nissiml | last post: by
9 posts views Thread by Amit D.Shinde | last post: by
3 posts views Thread by The ants are driving me crazy | last post: by
1 post views Thread by SAL | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.