System.Net.WebConnection.ResetNtlm C# (CSharp) Method

ResetNtlm() private method

private ResetNtlm ( ) : void
return void
		internal void ResetNtlm ()
		{
			ntlm_authenticated = false;
			ntlm_credentials = null;
			unsafe_sharing = false;
		}

Usage Example

Esempio n. 1
0
        static void PrepareSharingNtlm(WebConnection cnc, HttpWebRequest request)
        {
            if (!cnc.NtlmAuthenticated)
            {
                return;
            }

            bool needs_reset           = false;
            NetworkCredential cnc_cred = cnc.NtlmCredential;
            NetworkCredential req_cred = request.Credentials.GetCredential(request.RequestUri, "NTLM");

            if (cnc_cred.Domain != req_cred.Domain || cnc_cred.UserName != req_cred.UserName ||
                cnc_cred.Password != req_cred.Password)
            {
                needs_reset = true;
            }
#if NET_1_1
            if (!needs_reset)
            {
                bool req_sharing = request.UnsafeAuthenticatedConnectionSharing;
                bool cnc_sharing = cnc.UnsafeAuthenticatedConnectionSharing;
                needs_reset = (req_sharing == false || req_sharing != cnc_sharing);
            }
#endif
            if (needs_reset)
            {
                cnc.Close(false);                  // closes the authenticated connection
                cnc.ResetNtlm();
            }
        }
All Usage Examples Of System.Net.WebConnection::ResetNtlm