Пример #1
0
        public void Authenticate(Credentials credentials)
        {
            // We need to load the logon page first to get the session key
            string html = GetLogonPage();

            credentials.K1MagicString   = ExtractAuthK1.ExtractFrom(html);
            credentials.SessionKeyValue = webClient.GetCookieValue(SessionKeyName);

            webClient.AddCookie("alba_an", credentials.Account, BasePath.ApplicationPath, BasePath.Site);
            webClient.AddCookie("alba_us", credentials.User, BasePath.ApplicationPath, BasePath.Site);
            webClient.AddCookie(SessionKeyName, credentials.SessionKeyValue, "/", BasePath.Site);

            SubmitCredentials(credentials);
        }