日期:2014-05-18 浏览次数:21369 次
<bindings>
<netTcpBinding>
<binding name="customTcpBinding" transferMode="Streamed" maxReceivedMessageSize="904800000" receiveTimeout="01:30:00" >
<!--缺省 -->
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName"/>
</security>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="FileServer.ServicesBehavior">
<serviceMetadata httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<issuedTokenAuthentication allowUntrustedRsaIssuers="true"></issuedTokenAuthentication>
<clientCertificate>
<authentication certificateValidationMode="None"/>
</clientCertificate>
<serviceCertificate findValue="MyServer" storeLocation="CurrentUser" x509FindType="FindBySubjectName" storeName="My"/>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="FileServer.MyCustomValidator,FileServer"/>
</serviceCredentials>
</behavior>
------解决方案--------------------
说道流传输,默认的流传输是不支持断点续传的,我重写了文件流,让流传输支持断点续传。代码不难,有需要的吗?