bonjour ,
je compte ouvrir une page web avec IE et ce depuis mon code C# . la page necessite une authentification . j'aime que tous soit automatique pour cela je compte passer un objet credential à ma page web :
je ne trouve pas comment le passer , avez vous une idée ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
 
            InternetExplorer ie = new InternetExplorer();
            object obj = null ;
 
 
            // Instantiate a System.Net.CredentialCache object.
 
            System.Net.CredentialCache credentialCache = new System.Net.CredentialCache();
 
 
            System.Net.NetworkCredential credentials = new System.Net.NetworkCredential(CST_LOGCRM, CST_PWCRM, CST_DOMAIN);
 
 
            credentialCache.Add(new Uri(@"http://" + CST_WEBSERVER + @"/" + CST_ORGANISATION_NAME + @"/"), "NTLM", credentials);
 
 
            ie.Navigate("http://" + CST_WEBSERVER + "/" + CST_ORGANISATION_NAME + "/sfa/accts/edit.aspx?id={" + AccountId + "}", obj, obj, obj, obj);
 
            ie.Visible = true;