471,577 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,577 software developers and data experts.

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 18420
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
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.