的BasicHttpBinding
類有一個ReaderQuotas
屬性,您可以訪問覆蓋的屬性,如MaxArrayLength
,MaxBytesPerRead
等WCF修改爲HttpTransportBindingElement ReaderQuotas在CustomBinding
如何訪問ReaderQuotas
來實現同樣的事情用HttpTransportBindingElement
時在CustomBinding
而不是BasicHttpBinding
?
即:
var bindingElement = new HttpTransportBindingElement();
bindingElement.MaxBufferSize = 65536; // works
bindingElement.ReaderQuotas.MaxArrayLength = 65536; // error no ReaderQuotas member
var binding = new CustomBinding(bindingElements);
binding .ReaderQuotas.MaxArrayLength = 65536; // also no ReaderQuotas member
在此先感謝您的幫助。