首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

-C# System.OutOfMemoryException

2012-08-30 
求救---C# System.OutOfMemoryExceptionC# 进行数据加密的处理,中间红色加粗的地方出现System.OutOfMemory

求救---C# System.OutOfMemoryException
C# 进行数据加密的处理,中间红色加粗的地方出现System.OutOfMemoryException异常,各位高手给指点指点。
  using (FileStream fin = File.OpenRead(inFile),
  fout = File.OpenWrite(outFile))
  try
  {
  System.Text.Encoding iso8859 = Encoding.GetEncoding("ISO-8859-1");

  StringBuilder resultSb = new StringBuilder();
  int readResult = 0;
  while ((readResult = fin.ReadByte()) != c_EOF)
  {
  readResult ^= c_Key;
  resultSb.Append((char)readResult);[b][/b] }
  //
  fout.Write(iso8859.GetBytes(resultSb.ToString()),0,resultSb.Length);
  log.info(_logDic["LD_0068"]);
  return true;
  }
  catch (FileNotFoundException e)
  {
  return false;
  }
  catch (IOException e)
  {
  return false;
  }
  finally 
  {
  //破棄
  fin.Close();
  fout.Close();  
  }
--在线急等。。。。

[解决办法]
你确认是那句代码问题还是while 死循环了的问题
[解决办法]
c_EOF的值是多少?
c_EOF == -1吗?


热点排行