我的位置:首頁 >   > 

    [VB.Net]手動連接WCF服務,不透過app.config

    發表時間:
    Dim OP As ServiceReference2.API 'ServiceReference2=服務名稱 API=介面
    Dim EA As EndpointAddress = New EndpointAddress(New Uri("SVC網址"))
    Dim BHB As BasicHttpBinding = New BasicHttpBinding
    Dim CF As ChannelFactory(Of ServiceReference2.API) = New ChannelFactory(Of ServiceReference2.API)(BHB, EA)
    OP = CF.CreateChannel()