【发布时间】:2015-02-06 11:18:46
【问题描述】:
我正忙于编写一个文件服务器/客户端工具,它基本上使用托管服务向服务器发送和接收数据。由于此解决方案将被许多不同的人使用,因此不建议让他们去编辑 App.Config 文件以进行设置。我想做的是在运行时更改它,以便用户可以完全控制要使用的设置。所以,这是我的 App.Config 文件:
<system.serviceModel>
<services>
<service name="FI.ProBooks.FileSystem.FileRepositoryService">
<endpoint name="" binding="netTcpBinding"
address="net.tcp://localhost:5000"
contract="FI.ProBooks.FileSystem.IFileRepositoryService"
bindingConfiguration="customTcpBinding" />
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="customTcpBinding" transferMode="Streamed" maxReceivedMessageSize="20480000" />
</netTcpBinding>
</bindings>
</system.serviceModel>
我想做的是在执行应用程序时只更改地址(在本例中为 net.tcp://localhost:5000)。所以我必须能够读取当前值并将其显示给用户,然后接受他们的输入并将其保存回该字段。
【问题讨论】:
标签: c# wcf service servicehost