我已经使用转换文件Convert.ToBase64String
并保存到数据库。但是我在再次检索文件时遇到了问题。
请帮忙...
_copyLocation = ApplicationDeployment.CurrentDeployment.DataDirectory + "\\" +
DateTime.Now.ToString("dd_MM_yyyy_HH_mm_ss") + ".sdf";
File.Copy(ApplicationDeployment.CurrentDeployment.DataDirectory + "\\" +
"Data.sdf", _copyLocation);
byte[] byteArray = System.IO.File.ReadAllBytes(_copyLocation);
MemoryStream stream = new MemoryStream(byteArray);
stream.Read(byteArray, 0, (int)stream.Length);
保存到数据库为: Convert.ToBase64String(byteArray);