wcf如何修改 MaxArrayLength 属性(不使用配置文件)
之前做了个WCF运作良好,现在要做一个简单的传输,局域网,数据量大,结果MaxArrayLength属性太小,怎么改大?不使用配置文件。以前用了自定义绑定,是可以的,但我想再简化,如何处理?
EndpointAddress address = new EndpointAddress(string.Format("net.tcp://{0}:{1}/ScreenServerLib/Server/", SvrAddress, SvrPort));
ICollection<BindingElement> bindingElements = new List<BindingElement>();
TcpTransportBindingElement tcpBindingElement = new TcpTransportBindingElement();
----这里怎么写?
bindingElements.Add(tcpBindingElement);
tcpBindingElement.MaxReceivedMessageSize = int.MaxValue;
CustomBinding bind = new CustomBinding(bindingElements);
sClient = new ServiceReference1.ServerClient(bind, address);