//린큐개체
Contract.Data.PersonnelPerformanceReviewDetail ppd = this.datagrdPersonnelPerformanceReviewDetail.SelectedItem
as Contract.Data.PersonnelPerformanceReviewDetail;
if (ppd != null)
{
Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog(); //SaveFileDialog 오픈
dlg.DefaultExt = ppd.RatingFileType;
dlg.Filter =string.Format( "저장된 파일속성 ({0})|{0}" ,ppd.RatingFileType ); //데이터베이스에 저장되어져 있던 ".jpg"
if (dlg.ShowDialog() == true)
{
string filename = dlg.FileName; //SaveFileDialog 에서 선택된 경로
System.Data.Linq.Binary binaryFile = ppd.RatingFile; //바이너리 파일
using (System.IO.MemoryStream ms = new System.IO.MemoryStream(binaryFile.ToArray()))
{
FileStream outStream = File.OpenWrite(filename);
ms.WriteTo(outStream);
outStream.Flush();
outStream.Close();
}
} 'C#.NET IO' 카테고리의 다른 글
| [Linq.Binary]초간단 openFileDialog 파일 읽기/쓰기 (0) | 2010.04.06 |
|---|---|
| 구조체와 클래스를 파일로 입력 및 출력 (0) | 2010.01.03 |
| 디렉토리생성시 중복디렉토리 네임 방지 (0) | 2010.01.03 |
| [ DriveInfo ] 하드 디스크 정보 및 사용량을 알고 싶을때 (0) | 2010.01.03 |
| 파일 중복체크해서 저장하기 (0) | 2009.12.15 |
| [Serialize] 클래스 파일로 저장하기 및 불러오기 (0) | 2009.12.15 |
| [ MSDN ] 하드 디스크 정보 및 사용량을 알고 싶을때 (0) | 2009.12.15 |
| 응용 프로그램의 현재 작업 디렉터리를 가져오기 (0) | 2009.04.27 |