System.Net.CredentialCache credentialCache = new System.Net.CredentialCache(); credentialCache.Add( new System.Uri("http://www.yoururl.com/"), "Basic", new System.Net.NetworkCredential("username", "password") ); ...…
本文转自:https://blogs.msdn.microsoft.com/astoriateam/2010/07/21/odata-and-authentication-part-6-custom-basic-authentication/ You might remember, from Part 5, that Basic Authentication is built-in to IIS. So why do we need ‘Custom’ Basic Authentication?…