2013-03-07 46 views
0

我有一個web.configC#WCF的web.config

<?xml version="1.0"?> 
<configuration> 
    <system.web> 
    <authentication mode="Windows"/> 
    <compilation debug="true" targetFramework="4.0" /> 
    </system.web> 
    <system.serviceModel> 
    <bindings> 
     <customBinding> 
     <binding name="InstantMessagingBinding" closeTimeout="00:10:00"> 
      <textMessageEncoding> 
      <readerQuotas maxStringContentLength="200000" maxArrayLength="200000" /> 
      </textMessageEncoding> 
      <httpTransport keepAliveEnabled="false" maxReceivedMessageSize="200000" authenticationScheme="Ntlm"/> 
     </binding> 
     </customBinding> 
    </bindings> 
    ... 
    </system.serviceModel> 
<system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 
</configuration> 

我希望我的服務,從該文件讀取的closeTimeOut。 我知道如何閱讀AppSetting部分,但我不知道該怎麼做。

+0

可以粘貼你的web.config的節點? – 2013-03-07 10:04:46

+0

嘗試顯示您的託管代碼 – 2013-03-07 10:10:45

回答

0

您可以使用查看Session.Timeout知道超時值。

請看下面的鏈接,這將有助於您瞭解

Access settings

,或者你可以設置信息的應用程序設置和訪問