博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

IE错误Not enough storage is available to complete this operation

Posted on 2011-03-04 11:10  肖敏  阅读(2590)  评论(1编辑  收藏  举报

     【问题描述】

      工作中要用到HPQC,昨天登录HPQC的时候出错,错误信息:

      Microsoft Internet Explorer : 4.0 (compatible; MSIE 6.0) is not supported!

      Only Internet Explorer 6, Internet Explorer 7 and Internet Explorer 8 are supported. 

      这是因为HPQC主页中有段脚本,首先用navigator.appVersion 对象判断浏览器版本,navigator.appVersion的值为“4.0 (compatible; MSIE 6.0) ”。但是我明明装的是IE7.点击浏览器中About Internet Explorer菜单,显示的版本号为7,但是弹出一个对话框,提示信息:

      Not enough storage is available to complete this operation。当时并没有怀疑这个问题跟版本号出错是同一个原因。

     【问题分析】 

      原来一直从版本号错误为线索去找,查了一遍,检查了dll版本号,注册表信息,都没找到答案。后来根据第二个问题的提示信息“Not enough storage is available to complete this operation”搜索,很快的在微软的论坛找到了答案,一篇同名标题的帖子:

      http://social.msdn.microsoft.com/Forums/zh-SG/iewebdevelopment/thread/d863c31c-8a50-4e9d-9482-ec479d330658 

      这篇帖子就说得更详细了:

      http://jamiethompson.co.uk/web/2008/07/23/an-ie7-bug-that-returns-msie-60-user-agent-string/ 

     【问题解决】 

      原因就是HKLM/Software/Microsoft/Windows/CurrentVersion/Internet Settings/5.0/User Agent/Post Platform 注册表中的信息不能超过260个字符。我里面有CLR1.0 CLR.20 .CLR3.0....一大堆。删掉几个就可以了。

      【测试】

      关掉所有浏览器,重新打开一个新的。 

      在浏览器中输入javascript:document.write(navigator.appVersion); 显示结果:

      4.0 (compatible; MSIE 7.0; Windows NT 5.1; EmbeddedWB 14.52 from: http://www.bsalsa.com/ EmbeddedWB 14.52; .NET CLR 2.0.50727; MS-RTC LM 8; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; 

      点击浏览器中About Internet Explorer菜单,没有错误提示框了。

      打开HPQC,登录成功。

     【总结】 

      1.不要忽略任何错误提示信息,有可能几个错误都是互相关联的。

      2.尽量使用标准的错误提示信息为关键字寻找答案,这样定位比较准确。 

      3.另外 jamiethompson也提到了,使用navigator.appVersion来判断浏览器版本是不可靠的。