List<Question> questionList=new List<Question>();
questionList=iQuestion.findAll();
int i=0;
string tmppath = null;
int SeekVal=0; tmppath = (string)path;
FileStream fs;
fs = new FileStream(tmppath, FileMode.Truncate); BinaryWriter bw = new BinaryWriter(fs);
for(i=0;i<questionList.Count;i++)
{
string ss=questionList[i].FileResource.Length.ToString();
bw.Write(questionList[i].FileResource,(int)bw.Seek(SeekVal,SeekOrigin.Begin),
questionList[i].FileResource.Length);
SeekVal = SeekVal + questionList[i].FileResource.Length;
}
bw.Write(questionList[i].FileResource,(int)bw.Seek(SeekVal,SeekOrigin.Begin),
questionList[i].FileResource.Length); 这句话老报错,求解,谢谢。
求大神帮助啊,求大神啊!
questionList=iQuestion.findAll();
int i=0;
string tmppath = null;
int SeekVal=0; tmppath = (string)path;
FileStream fs;
fs = new FileStream(tmppath, FileMode.Truncate); BinaryWriter bw = new BinaryWriter(fs);
for(i=0;i<questionList.Count;i++)
{
string ss=questionList[i].FileResource.Length.ToString();
bw.Write(questionList[i].FileResource,(int)bw.Seek(SeekVal,SeekOrigin.Begin),
questionList[i].FileResource.Length);
SeekVal = SeekVal + questionList[i].FileResource.Length;
}
bw.Write(questionList[i].FileResource,(int)bw.Seek(SeekVal,SeekOrigin.Begin),
questionList[i].FileResource.Length); 这句话老报错,求解,谢谢。
求大神帮助啊,求大神啊!
解决方案 »
- 在windows中使用monodevelop开发的程序还需要在客户机上安装.NET Framework吗?
- string[] 如何删除里面的一项?
- C#连接ORACLE数据库的问题
- 数据库时间比对问题,急急急急!!!!!!
- C# 控件不可见性
- GGJJ们:datagrid中用dropdownlist改变某一行的值有没有什么好办法呀??
- “/”应用程序中的服务器错误。找不到指定的模块。 (异常来自 HRESULT:0x8007007E)
- gridview中的CommandArgument怎么用,在线等,着急!!
- 关于winform的问题-----------------求关注
- 谁能给一段更新数据库的代码?
- flex 在地图中画个圆
- datagridview 树形显示的问题
questionList[i].FileResource.Length);
偏移量和长度超出数组的界限,或者计数大于从索引到源集合结尾处的元素数量。这行有错,错误信息是以上。
{
bw.Write(questionList[i].FileResource);
}
这样可以写多条