How to set proxy with credentials to generated WCF client?

前端 未结 3 1344
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-16 16:28

I have a problem to connect to my WCF service if customer is using proxy with credentials. I\'m unable to find the way to set credential to generated client proxy.

3条回答
  •  爱一瞬间的悲伤
    2020-12-16 17:04

    I'm not entirely sure if this is what you are looking for but here you go.

      MyClient client = new MyClient();
      client.ClientCredentials.UserName.UserName = "u";
      client.ClientCredentials.UserName.Password = "p";
    

提交回复
热议问题