文件保存方法

if (MessageBox.Show("采集一帧图像成功!\n是否保存", "图像处理", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    string path = string.Empty;  //文件路径
                    SaveFileDialog save = new SaveFileDialog();
                    save.Filter = "RAW File(*.raw)|*.RAW|All File(*.*)|*.*||";
                    save.FileName = "DeYiPaiFinger";
                    save.AddExtension = true;
                    if (save.ShowDialog() == DialogResult.OK)
                        path = save.FileName;
                    if (path != string.Empty)
                    {
                        FileStream fsFile = new FileStream(path, FileMode.Create);

                        fsFile.Seek(0, SeekOrigin.Begin);

                        fsFile.Write(FPRawData, 0, FPRawData.Length);
                        fsFile.Close();
                    }
                }

你可能感兴趣的:(C#)