0
所以這裏是我的客戶端App.config
,但我需要用C#代碼來做到這一點,所以任何人都可以幫助我嗎?我嘗試了一些方法來做到這一點,但我仍然無法找到如何。在App.Config中的C#端點
<!--<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IInfo" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://appserver.gwp.ge/CustomerService/Info.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IInfo"
contract="BillingService.IInfo" name="BasicHttpBinding_IInfo" />
</client>
</system.serviceModel>
</configuration>-->
https://msdn.microsoft.com/en-us/library/ms731862(v=vs.110).aspx 或 http://stackoverflow.com/questions/2943148/how-to-programmatically-connect-a -client-to-a-wcf-service –
我認爲這可能有所幫助: [http://stackoverflow.com/questions/11583882/programatically-adding-an-endpoint](http://stackoverflow.com/questions/11583882/programatically-adding-an-endpoint) –