Пример #1
0
        private async void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
        {
            rootNode = await parser.getRootNodeOfPage(GlobalVariables.linkLogin);

            string livestreet_security_key = AbstractParser.getLivestreetSecurityKey(rootNode);
            string sessionId     = AbstractParser.getSessionId(rootNode);
            string authorize_uri = GlobalVariables.linkAjaxLogin
                                   + Login.Text
                                   + "&password="******"&security_ls_key="
                                   + livestreet_security_key;
            HttpClient client = new HttpClient();

            var response = await client.GetStringAsync(authorize_uri);

            var appSettings = Windows.Storage.ApplicationData.Current.LocalSettings;

            appSettings.Values["livestreet_security_key"] = livestreet_security_key;
            appSettings.Values["sessionId"] = sessionId;

            JsonResponse json = JsonConvert.DeserializeObject <JsonResponse>(response);

            if (json.bStateError == false)
            {
                isLoginSuccessed = true;
            }
        }