public App()// { if (He.Settings.isWebProxy) { if (He.Settings.WebProxyUri != "") { He.proxy.Address = new Uri(He.Settings.WebProxyUri); He.proxy.Credentials = new NetworkCredential(He.Settings.WebProxyUser, He.Settings.WebProxyPassWord); } } if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"Settings.st")) { He.lsd = (LoadSettingsData)JSON.JsonToObject(Encoding.Default.GetString(Convert.FromBase64String(He.TextDecrypt(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"Settings.st"), FanyiBox.MD5.EncryptToMD5string("Settings.st")))), He.lsd); } else { He.SaveLoadSettings(); } Current.DispatcherUnhandledException += Current_DispatcherUnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Startup += delegate { bool ret; mutex = new Mutex(true, "Lemon App", out ret); if (!ret) { Environment.Exit(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++; } }