ReadString上的配额异常 [英] Quota Exception on ReadString

查看:90
本文介绍了ReadString上的配额异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

System.Runtime.WindowsRuntime.dll中出现"System.Runtime.InteropServices.COMException"类型的异常,但未在用户代码中处理

An exception of type 'System.Runtime.InteropServices.COMException' occurred in System.Runtime.WindowsRuntime.dll but was not handled in user code

WinRT信息:调用请求处理错误。

WinRT information: Invoke request processing error.

其他信息:没有足够的配额可用于处理此命令。

Additional information: Not enough quota is available to process this command.

我尝试执行以下代码时遇到此异常:

I get this exception trying to execute the following code:

StorageFile sampleFile =
await
storageFolder。 GetFileAsync(
@" index.htm" );

StorageFile sampleFile = await storageFolder.GetFileAsync(@"index.htm");

RandomAccessStream
readStream =
等待
sampleFile.OpenAsync(
FileAccessMode 。读;)

RandomAccessStream readStream = await sampleFile.OpenAsync(FileAccessMode.Read);

//将
文件读取到IInputStream流

//read the file to an IInputStream stream

IInputStream
inputStream = readStream.GetInputStreamAt(0);

IInputStream inputStream = readStream.GetInputStreamAt(0);

//从流中创建
a DataReader

uint
numBytesLoaded =
等待
dataReader.LoadAsync((
uint
readStream.Size);

uint numBytesLoaded = await dataReader.LoadAsync((uint) readStream.Size);

这个 。resultText.Text
=
"以下文字是从
index.htm中读取的:\ n \ n"
+ dataReader.ReadString(numBytesLoaded);

this.resultText.Text = "The following text was read from index.htm:\n\n" + dataReader.ReadString(numBytesLoaded);

只要numBytesLoaded大于(32k到40之间的某个数字 k),就会发生配额异常[我厌倦了二元搜索!])。

任何想法是什么配额,以及我如何解决它?我不知道ReadString有限制吗?

 

谢谢!

推荐答案

您好Aldie - 您可以获取转发例外并通过电子邮件发送给我?  Microsoft的MSMALL
Hi Aldie - can you get a dump of the exception and email it to me?  MSMALL at Microsoft


这篇关于ReadString上的配额异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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