Ejemplo n.º 1
0
 private void Font_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     FontFamily = (Font.SelectedItem as ListBoxItem).FontFamily;
     He.Settings.FontFamilly = (Font.SelectedItem as ListBoxItem).FontFamily.Source;
     He.SaveSettings();
     popup.IsOpen = false;
 }
Ejemplo n.º 2
0
 private void TX_MouseDown(object sender, MouseButtonEventArgs e)
 {
     Microsoft.Win32.OpenFileDialog o = new Microsoft.Win32.OpenFileDialog();
     if (o.ShowDialog() == true)
     {
         var image = new System.Drawing.Bitmap(o.FileName);
         TX.Background         = new ImageBrush(image.ToImageSource());
         He.Settings.UserImage = o.FileName;
         He.SaveSettings();
     }
 }
Ejemplo n.º 3
0
        private async void NaAsync(object sender, WebBrowserNavigatedEventArgs e)
        {
            if (index != 0)
            {
                if (wb.DocumentTitle == "我的QQ中心")
                {
                    op.IsOpen = false;
                    var qq = He.Text(wb.Document.Cookie, "uin=o", ";", 0);
                    if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + qq + @"@qq.com.st"))
                    {
                        He.Settings = (SettingsData)JSON.JsonToObject(Encoding.Default.GetString(Convert.FromBase64String(He.TextDecrypt(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + qq + @"@qq.com.st"), FanyiBox.MD5.EncryptToMD5string(qq + "@qq.com.st")))), He.Settings);
                    }
                    else
                    {
                        He.SaveSettings(qq + "@qq.com");
                    }
                    var     sl = He.Text(await Uuuhh.GetWebAsync("http://r.pengyou.com/fcg-bin/cgi_get_portrait.fcg?uins=" + qq, Encoding.Default), "portraitCallBack(", ")", 0);
                    JObject o  = JObject.Parse(sl);
                    try
                    {
                        await Uuuhh.HttpDownloadFileAsync($"http://q2.qlogo.cn/headimg_dl?bs=qq&dst_uin={qq}&spec=100", AppDomain.CurrentDomain.BaseDirectory + qq + ".jpg");

                        var image = new System.Drawing.Bitmap(AppDomain.CurrentDomain.BaseDirectory + qq + ".jpg");
                        TX.Background = new ImageBrush(image.ToImageSource());
                    }
                    catch { }
                    He.Settings.RobotName      = o[qq][6].ToString();
                    He.Settings.UserImage      = AppDomain.CurrentDomain.BaseDirectory + qq + ".jpg";
                    He.Settings.LemonAreeunIts = qq + "@qq.com";
                    He.Settings.RNBM           = (Boolean)RM.IsChecked;
                    He.SaveSettings();
                    He.lsd.NAME = qq;
                    He.lsd.RNBM = (Boolean)RM.IsChecked;
                    He.lsd.TX   = AppDomain.CurrentDomain.BaseDirectory + qq + ".jpg";
                    He.SaveLoadSettings();
                    (Resources["OnLoaded1"] as Storyboard).Begin();
                    tr.Start();
                }
                else if (wb.DocumentText.Contains("安全验证"))
                {
                    op.IsOpen = true;
                    rk.Text   = "请输入验证码";
                }
                else
                {
                    rk.Text = "登录失败,请检查账号和密码."; op.IsOpen = false;
                }
            }
            else
            {
                index++;
            }
        }
Ejemplo n.º 4
0
 private void textBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         if (textBox.Text != "")
         {
             GetWeather(textBox.Text);
             He.Settings.WeatherInfo = textBox.Text;
             He.SaveSettings();
         }
     }
 }
Ejemplo n.º 5
0
        private void Border_MouseDown(object sender, MouseButtonEventArgs e)
        {
            ListJson lj = new ListJson();

            if (He.Settings.MusicList != "")
            {
                lj = MusicControl.JsonToObject(He.Settings.MusicList, lj) as ListJson;
            }
            lj.List.Add(new ListItem()
            {
                ItemText = (this.Music as Music)
            });
            He.Settings.MusicList = MusicControl.ToJSON(lj);
            He.SaveSettings();
        }
Ejemplo n.º 6
0
        private void Window_MouseMove(object sender, MouseEventArgs e)
        {
            if (Left > SystemParameters.WorkArea.Height - 200)
            {
                (Resources["l"] as Storyboard).Begin();
            }
            else
            {
                (Resources["r"] as Storyboard).Begin();
            }
            var d = this.RestoreBounds;

            He.Settings.HaTop = new OnRect {
                x = d.X, y = d.Y, width = d.Width, height = d.Height
            };
            He.SaveSettings();
        }
Ejemplo n.º 7
0
 private void Border_MouseDown(object sender, MouseButtonEventArgs e)
 {
     try
     {
         vce.Play();
         RenderTargetBitmap bmp = new RenderTargetBitmap(
             (int)vce.ActualWidth,
             (int)vce.ActualHeight,
             96, 96, PixelFormats.Default);
         bmp.Render(vce);
         BitmapEncoder encoder = new JpegBitmapEncoder();
         encoder.Frames.Add(BitmapFrame.Create(bmp));
         using (MemoryStream ms = new MemoryStream())
         {
             encoder.Save(ms);
             byte[] a = ms.ToArray();
             byte[] b = Convert.FromBase64String(He.TextDecrypt(File.ReadAllText(He.lsd.NAME + ".FaceData"), FanyiBox.MD5.EncryptToMD5string(He.lsd.NAME + ".FaceData")));
             vce.Stop();
             var client = new Baidu.Aip.Face.Face("75bl82qIt9Rtly6Na6wqYUmm", "pMO9ZSQSsZFNvMMnXy5L3GaQbpWG6Fyw");
             var images = new byte[][] { a, b };
             var result = double.Parse(client.FaceMatch(images).First.First.Last.Last.First.ToString());
             if (result >= 90)
             {
                 if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + He.lsd.NAME + "@qq.com.st"))
                 {
                     He.Settings = (SettingsData)JSON.JsonToObject(Encoding.Default.GetString(Convert.FromBase64String(He.TextDecrypt(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + He.lsd.NAME + "@qq.com.st"), FanyiBox.MD5.EncryptToMD5string(He.lsd.NAME + "@qq.com.st")))), He.Settings);
                 }
                 else
                 {
                     He.SaveSettings(He.lsd.NAME + "@qq.com");
                 }
                 (Resources["OnLoaded1"] as Storyboard).Begin();
                 tr.Start();
             }
             else
             {
                 txb.Text = "识别失败";
             }
         }
     }
     catch { txb.Text = "识别失败"; }
 }
Ejemplo n.º 8
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     if (He.lsd.RNBM)
     {
         if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + He.lsd.NAME + "@qq.com.st"))
         {
             He.Settings = (SettingsData)JSON.JsonToObject(Encoding.Default.GetString(Convert.FromBase64String(He.TextDecrypt(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + He.lsd.NAME + "@qq.com.st"), FanyiBox.MD5.EncryptToMD5string(He.lsd.NAME + "@qq.com.st")))), He.Settings);
         }
         else
         {
             He.SaveSettings(He.lsd.NAME + "@qq.com");
         }
         (Resources["OnLoaded1"] as Storyboard).Begin();
         tr.Start();
     }
     Email.Text = He.lsd.NAME;
     if (System.IO.File.Exists(He.lsd.TX))
     {
         var image = new System.Drawing.Bitmap(He.lsd.TX);
         TX.Background = new ImageBrush(image.ToImageSource());
     }
     RM.IsChecked = He.lsd.RNBM;
 }
Ejemplo n.º 9
0
 private void Border_MouseDown_1(object sender, MouseButtonEventArgs e)
 {
     if (os == 0)
     {
         os = 1;
         RotateTransform rtf = new RotateTransform();
         (sender as Border).RenderTransform = rtf;
         DoubleAnimation dbAscending = new DoubleAnimation(0, 170, TimeSpan.FromSeconds(0.3));
         rtf.BeginAnimation(RotateTransform.AngleProperty, dbAscending);
         textBox1.Text = He.Settings.SearchUrl;
     }
     else
     {
         os = 0;
         RotateTransform rtf = new RotateTransform();
         (sender as Border).RenderTransform = rtf;
         DoubleAnimation dbAscending = new DoubleAnimation(170, 0, TimeSpan.FromSeconds(0.3));
         rtf.BeginAnimation(RotateTransform.AngleProperty, dbAscending);
         He.Settings.SearchUrl = textBox1.Text;
         He.SaveSettings();
         textBox1.Text = "搜索";
     }
 }
Ejemplo n.º 10
0
 private void border_MouseDown(object sender, MouseButtonEventArgs e)
 {
     this.Visibility = Visibility.Collapsed;
     He.Settings.MIDLIST.Remove(this.MID);
     He.SaveSettings();
 }