コード例 #1
0
        private void SetSinkProperties(IMessage msg)
        {
            if (!_authenticationParamsSet)
            {
                String url = (String)msg.Properties["__Uri"];

                UrlAuthenticationEntry entr =
                    UrlAuthenticator.GetAuthenticationEntry(url);

                if (entr != null)
                {
                    IClientChannelSink last = this;

                    while (last.NextChannelSink != null)
                    {
                        last = last.NextChannelSink;
                    }

                    // last now contains the transport channel sink

                    last.Properties["username"] = entr.Username;
                    last.Properties["password"] = entr.Password;
                }



                _authenticationParamsSet = true;
            }
        }
コード例 #2
0
 public static void SetDefaultAuthenticationEntry(String userName,
                                                  String password)
 {
     _defaultAuthenticationEntry = new UrlAuthenticationEntry(
         null, userName, password);
 }