这听起来可能很愚蠢,但是有什么方法可以将ArrayLength转换成兆字节吗?
XmlDictionaryReaderQuotas readerQuotas = new XmlDictionaryReaderQuotas();
readerQuotas.MaxArrayLength = int.MaxValue;
binding.ReaderQuotas = readerQuotas;我得到了这部分,我不知道如何给它的最大大小50兆字节。
发布于 2014-03-18 13:33:49
在MSDN中,MaxArrayLength看起来是以字节为单位的:
获取并设置允许的最大数组长度。 属性值类型: System.Int32 允许的最大数组长度。缺省值为16384。 此配额控制各种API调用创建和返回的最大数组长度。它影响特殊的数组API以及从ReadContentAsBase64()返回的字节数组。此限制不影响使用数据填充数组的ReadContentAsBase64()覆盖。
1KB是1024字节。1MB是1024 KB。听起来你是在找这样的东西:
readerQuotas.MaxArrayLength = 1024 * 1024 * 50; // 50 MBhttps://stackoverflow.com/questions/22480941
复制相似问题