2010-07-01 64 views
1

這裏移動應用程序是我的代碼保存對話框中使用C#

 SaveFileDialog dialog = new SaveFileDialog(); 
     if (dialog.ShowDialog() == DialogResult.OK) 
     { 
     aspectRatioPictureBox1.Photo.Save(dialog.FileName, 
      System.Drawing.Imaging.ImageFormat.Bmp); 
     } 
     dialog.Dispose(); 

我要保存mypictures文件與用戶

回答

1

定名爲defaultly文件夾,爲什麼要用SaveFileDialog?提示用戶提供文件名以保存並將該文件保存到具有該文件名的MyPictures特殊文件夾中。

Environment.SpecialFolder special = Environment.SpecialFolder.MyPictures; 
string MyPicturesLocation = Environment.GetFolderPath(special); 

//prompt the user for file-name and save it to MyPicturesLocation here.