Ejemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Properties.Settings.Default.Reset();
            string Path = Environment.GetFolderPath(Environment.SpecialFolder.Cookies);

            System.IO.Directory.Delete(Path, true);
            try
            {
                System.IO.Directory.Delete(Path, true);
            }
            catch (Exception)
            {
            }
            MainWindow Login = new MainWindow();

            Login.Show();
            this.Close();
            Application.Current.Dispatcher.Invoke(() =>
            {
                Maiven window3 = Application.Current.Windows.OfType <Maiven>().FirstOrDefault();
                if (window3 != null)
                {
                    window3.Close();
                }
            });
        }
Ejemplo n.º 2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            HttpRequest CheckToken = new HttpRequest();

            CheckToken.AddUrlParam("access_token", Properties.Settings.Default.AccessToken);
            CheckToken.AddUrlParam("v", "5.63");
            string Result = CheckToken.Get("https://api.vk.com/method/account.setOffline").ToString();
            Dictionary <string, string> Dict = new Dictionary <string, string>();

            try
            {
                Dict = JsonConvert.DeserializeObject <Dictionary <string, string> >(Result);
            }
            catch
            {
                Dict.Add("response", "0");
            }
            if (Dict["response"] != "1")
            {
                AuthForm GetToken = new AuthForm();
                GetToken.ShowDialog();
            }
            Maiven open = new Maiven();

            open.Show();
            this.Close();
        }