FileStream VoiceFile = new FileStream("D:\\Program Files\\RecordServer\\Database\\voiceFile\\" + a, FileMode.Open); UAccessory uAccessorytemp = new UAccessory();
uAccessorytemp.Size = VoiceFile.Length.ToString();
uAccessorytemp.People.Code = ((UPeople)Session["LoginPeople"]).Code;
uAccessorytemp.Time = DateTime.Now;
uAccessorytemp.PrefixName = VoiceFile.Name.Substring(VoiceFile.Name.LastIndexOf("\\") + 1);
uAccessorytemp.SuffixName = VoiceFile.Name.Substring(VoiceFile.Name.LastIndexOf(".") + 1);
我写到这里就不会了,实体uAccessorytemp.content是二进制的类型,我想把VoiceFile 这个文件转化成二进制,然后存进数据库里,应该怎么写,才能转化?
uAccessorytemp.Size = VoiceFile.Length.ToString();
uAccessorytemp.People.Code = ((UPeople)Session["LoginPeople"]).Code;
uAccessorytemp.Time = DateTime.Now;
uAccessorytemp.PrefixName = VoiceFile.Name.Substring(VoiceFile.Name.LastIndexOf("\\") + 1);
uAccessorytemp.SuffixName = VoiceFile.Name.Substring(VoiceFile.Name.LastIndexOf(".") + 1);
我写到这里就不会了,实体uAccessorytemp.content是二进制的类型,我想把VoiceFile 这个文件转化成二进制,然后存进数据库里,应该怎么写,才能转化?
解决方案 »
- Microsoft Jet 数据库引擎找不到输入表或查询 'Admin'。 确定它是否存在,以及它的名称的拼写是否正确。
- .net里点击button之后变灰如何实现
- 很急!!关于菜单用户控件,在同一个页面中能同时使用两个相同的控件吗?
- |zyciis| 200分求 如何从一个未知的System.Collections.Generic.List<UserInfo>转换为System.Data.DataSet,再转回去
- 一个页面里有几个ascx的用户控件,其中一个中有提交事件,提交后另外的控件就不显示了,如何解决?
- 关于水晶报表:为什么报表顶部的上一页、下一页图片按钮显示不出来?
- 请问如何把本地的"localhost"改为"localhost."
- .net的速度,较郁闷,谁能解答???
- 推荐一个好东东,ExtJsExtenderControl。基于extjs和asp.net ajax ,开源项目
- 一个数据库连接问题?不知那里错了差错?
- extjs 中怎么比较两个DateField的时间
- 如何在我的页面充Q币?
FileStream fsFileRead = new FileStream(
FileName,
FileMode.Open,
FileAccess.Read);
byteDataValue = new byte[LINE_SIZE];
charDataValue = new char[LINE_SIZE];
string strLine = string.Empty;
int intLength = 0;
while (fsFileRead.Read(byteDataValue, 0, byteDataValue.Length) == byteDataValue.Length)
{
Encoding.Default.GetDecoder().GetChars(byteDataValue, 0, byteDataValue.Length, charDataValue, 0, true);
strLine = new string(charDataValue);
...
...
...
intLength += LINE_SIZE;
fsFileRead.Seek(intLength, SeekOrigin.Begin);
}