请高手解决xmlTextReader读图片问题

wthorse 2006-07-31 11:33:17
int readByte = 0;
i+=1;
int bytesToRead = 100;
//string NewValue=this.GetValue(reader.Value);
//XmlTextReader xmlTxtRd = new XmlTextReader("WriteXml5.xml");
string strMapName=this.strFromXml.Replace("xml","jpg");
strMapName=i.ToString()+strMapName;
FileStream fs = new FileStream(strMapName,FileMode.Create);
BinaryWriter bw = new BinaryWriter(fs);
byte[] base64buffer = new byte[bytesToRead];
//base64buffer=Convert.FromBase64String(NewValue);
do
{
//readByte = reader.ReadBase64(base64buffer,0,bytesToRead);
readByte = reader.ReadBase64(base64buffer,0,bytesToRead);
bw.Write(base64buffer,0,readByte);
}while(readByte <= bytesToRead);

bw.Flush();
bw.Close();
fs.Close();
图片能产生,还是报异常问题.网上资料找的差不多了.唉.
...全文
223 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wthorse 2006-08-03
  • 打赏
  • 举报
回复
解决了.
wthorse 2006-08-01
  • 打赏
  • 举报
回复
还有思路吗?刚才我发现vb写的要比c#长
wthorse 2006-07-31
  • 打赏
  • 举报
回复
deng
wthorse 2006-07-31
  • 打赏
  • 举报
回复
问题好象就在这,按照.net标准xml里是没有=号的(在image)但vb5编译后有(好象)
Knight94 2006-07-31
  • 打赏
  • 举报
回复
那你就需要分析一下,存入的格式和读取的格式是否一样。
wthorse 2006-07-31
  • 打赏
  • 举报
回复
存人是别人用vb5存人的.我只读取......
Knight94 2006-07-31
  • 打赏
  • 举报
回复
你如何存入的。

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧