1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
string certPath = @"C:\cb\certificat\Test.cer";
...
NetworkCredential credentials = new NetworkCredential();
CredentialCache cache = new CredentialCache();
classProxy proxy = new classProxy();
.....
proxy.Url = @"https://....";
proxy.ClientCertificates.Add(X509Certificate.CreateFromCertFile(certPath));
credentials.UserName = username;
credentials.Password = password;
proxy.PreAuthenticate = true;
cache.Add(new Uri("https://...."), "Basic", credentials);
proxy.Credentials = cache;
proxy.EnableDecompression = true;
....
res = proxy.chercher(....);
.... |
Partager