的TextReader读取和ReadToEnd的挂起没有抛出异常 [英] TextReader Read and ReadToEnd hangs without throwing exception

查看:241
本文介绍了的TextReader读取和ReadToEnd的挂起没有抛出异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法知道,TextReader.Read或TextReader.ReadToEnd呼叫的呼叫将挂起没有抛出exeption我做的调用之前?

Is there a way to know that a call to TextReader.Read or TextReader.ReadToEnd call will hang without throwing exeption before I do the call?


try
{
 using (var filterReader = new EPocalipse.IFilter.FilterReader(tempFileName))
 {
  mediaContent = filterReader.ReadToEnd();
 }
}
catch (Exception e)
{
 Log.Error("DealerPortalIndex Error on file: " + tempFileName, e, this);
 mediaContent = string.Empty;
}



filterReader.ReadToEnd()挂起,从来没有抛出异常,就一定.xls文件(也许更多的文件)

filterReader.ReadToEnd() hangs and never throws exception on a certain .xls file (maybe more file)

我也尝试使用filterReader.Read(字符{},INT,INT)读取模块,并得到了同样的问题。

I have also tried using a filterReader.Read(char{}, int, int) to read block and get the same problem.

推荐答案

(你说的TextReader在你的代码,但这个例子是使用EPocalips IFilter的模块。)

(You say textreader in your code, but the example is using EPocalips IFilter module.)

我认为这是EPocalipse IFilter的一个bug。我不知道如何更新自己的代码,但几年前我记得的东西达到同样的效果,当我与IFilter的工作和所使用的EPocalipse代码。

I think it's a bug in EPocalipse IFilter. I don't know how updated their code is, but I recall something to the same effect some years ago when I was working with IFilters and used the EPocalipse code.

您应在调试器中运行它,并破解密码,看看那里的EPocalipse库它的悬挂。 。最有可能的死循环

You should run it in the debugger and break the code to see where in the EPocalipse library it's hanging. Most likely it's stuck in a loop.


我发现我的旧更新的代码,并把它挂在SkyDrive中(的Epocalipse.IFilter.zip )。看它是否解决您的问题。它具有检测无限的IFilter解析循环和Excel与锁定的单元格的文件。

I found my old updated code and put it up on skydrive (Epocalipse.IFilter.zip). See if it solves your problems. It has detection for infinite IFilter parse loops, and excel files with locked cells.

这篇关于的TextReader读取和ReadToEnd的挂起没有抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆