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++; } }
public static async System.Threading.Tasks.Task <string> NewText(string con) { HttpWebRequest hwr = (HttpWebRequest)WebRequest.Create("https://git.oschina.net/TwilightLemon/Updata/raw/master/UNVTX"); hwr.Proxy = He.proxy; var o = await hwr.GetResponseAsync(); StreamReader sr = new StreamReader(o.GetResponseStream()); var st = He.Text(await sr.ReadToEndAsync(), "----UTX-START---", "----UTX-STOP---", 0); return(st.Replace(".", "\r\n")); }
private void textBlock4_MouseDown(object sender, MouseButtonEventArgs e) { DOWN.Visibility = Visibility.Visible; listBox.Visibility = Visibility.Collapsed; string guid = "20D919A4D7700FBC424740E8CED80C6F"; string ioo = Uuuhh.GetWeb($"http://59.37.96.220/base/fcgi-bin/fcg_musicexpress2.fcg?version=12&miniversion=92&key=19914AA57A96A9135541562F16DAD6B885AC8B8B5420AC567A0561D04540172E&guid={guid}"); string vkey = He.Text(ioo, "key=\"", "\" speedrpttype", 0); string uri = $"http://182.247.250.19/streamoc.music.tc.qq.com/M500{musicid}.mp3?vkey={vkey}&guid={guid}"; WebClient dc = new WebClient(); dc.Proxy = He.proxy; dc.DownloadFileAsync(new Uri(uri), AppDomain.CurrentDomain.BaseDirectory + $@"MusicDownload/{textBlock1.Text}.mp3"); dc.DownloadFileCompleted += OK; dc.DownloadProgressChanged += DownloadFileCompleted; }
private async void qrcode_MouseDown(object sender, MouseButtonEventArgs e) { wb.Navigate("http://ui.ptlogin2.qq.com/cgi-bin/login?appid=1006102&s_url=http://id.qq.com/index.html&hide_close_icon=1"); await Task.Delay(1000); string str = wb.Document.Body.OuterHtml; MatchCollection matches; matches = Regex.Matches(str, @"<img\b[^<>]*?\bsrc[\s\t\r\n]*=[\s\t\r\n]*[""']?[\s\t\r\n]*(?<imgUrl>[^\s\t\r\n""'<>]*)[^<>]*?/?[\s\t\r\n]*>", RegexOptions.IgnoreCase); var t = matches[1].Value.ToString(); Regex reg = new Regex(@"<img.*?src=""(?<src>[^""]*)""[^>]*>", RegexOptions.IgnoreCase); MatchCollection mc = reg.Matches(t); var content = mc[0].Groups["src"].Value; t = He.Text(content + "\"", "t=", "\"", 0); qrcode.Background = new ImageBrush(new BitmapImage(new Uri(content))); // op.IsOpen = true; index = 0; }
public static async System.Threading.Tasks.Task <bool> IsLemonNew(string con) { try { HttpWebRequest hwr = (HttpWebRequest)WebRequest.Create("https://git.oschina.net/TwilightLemon/Updata/raw/master/UNVTX"); hwr.Proxy = He.proxy; var o = await hwr.GetResponseAsync(); StreamReader sr = new StreamReader(o.GetResponseStream()); string html5 = He.Text(await sr.ReadToEndAsync(), "----UVN-START---", "----UVN-STOP---", 0); if (con == html5) { return(false); } else { return(true); } } catch { return(false); } }
private async void io(object sender, EventArgs e) { // try { s.Data = Geometry.Parse("M2.432,11.997L13.69,1.714c0.393-0.392,0.393-1.028,0-1.42c-0.393-0.392-1.031-0.392-1.424,0L0.286,11.236c-0.21,0.209-0.299,0.487-0.285,0.76c-0.014,0.274,0.075,0.551,0.285,0.76l11.98,10.942c0.393,0.392,1.031,0.392,1.424,0c0.393-0.392,0.393-1.028,0-1.42L2.432,11.997z"); string i = ""; if (listBox.SelectedIndex != listBox.Items.Count) { i = (listBox.Items[listBox.SelectedIndex + 1] as MusicItemControl).Content; listBox.SelectedItem = listBox.Items[listBox.SelectedIndex + 1]; } else { i = (listBox.Items[0] as MusicItemControl).Content; listBox.SelectedItem = listBox.Items[0]; } isR = true; textBlock1.Text = i; lrcname.Text = ((listBox.SelectedItem as MusicItemControl).Music as string[])[1]; zk.Text = ((listBox.SelectedItem as MusicItemControl).Music as string[])[3]; img = ((listBox.SelectedItem as MusicItemControl).Music as string[])[22]; He.on = $"https://y.gtimg.cn/music/photo_new/T002R300x300M000{img}.jpg"; tx.Background = new ImageBrush(new BitmapImage(new Uri(He.on))); musicid = ((listBox.SelectedItem as MusicItemControl).Music as string[])[20]; // if (!File.Exists(AppDomain.CurrentDomain.BaseDirectory + $@"MusicCache/{i}.mp3")) //{ // musicurl = $"http://cc.stream.qqmusic.qq.com/C100{musicid}.m4a?fromtag=52"; string guid = "20D919A4D7700FBC424740E8CED80C6F"; string ioo = Uuuhh.GetWeb($"http://59.37.96.220/base/fcgi-bin/fcg_musicexpress2.fcg?version=12&miniversion=92&key=19914AA57A96A9135541562F16DAD6B885AC8B8B5420AC567A0561D04540172E&guid={guid}"); string vkey = He.Text(ioo, "key=\"", "\" speedrpttype", 0); musicurl = $"http://182.247.250.19/streamoc.music.tc.qq.com/M500{musicid}.mp3?vkey={vkey}&guid={guid}"; player.Open(new Uri(musicurl)); player.Play(); t.Start(); //WebClient dc = new WebClient() //{ // Proxy = He.proxy //}; //dc.DownloadFileCompleted += Fis; //dc.DownloadFileAsync(new Uri(musicurl), AppDomain.CurrentDomain.BaseDirectory + $@"MusicCache/{i}.mp3"); /////等待播放 //loading.Visibility = Visibility.Visible; // } // else // { // player.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + $@"MusicCache/{i}.mp3")); // player.Play(); //t.Start(); // } if (!File.Exists(AppDomain.CurrentDomain.BaseDirectory + $@"MusicCache/{textBlock1.Text}.lrc")) { string lrc = ((listBox.SelectedItem as MusicItemControl).Music as string[])[0]; string lrcid = lrc.Substring(lrc.Length - 2, 2); // MessageBox.Show(He.Text(sr.ReadToEnd(), @"<lyric><![CDATA[", "]]></lyric>", 0)); FileStream fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + $@"MusicCache/{i}.lrc", FileMode.Create); StreamWriter sw = new StreamWriter(fs); string ijo = He.Text(await Uuuhh.GetWebUAsync($"http://music.qq.com/miniportal/static/lyric/{lrcid}/{lrc}.xml"), @"<lyric><![CDATA[", "]]></lyric>", 0).Replace("'", "'"); if (ijo != "") { await sw.WriteAsync(ijo); await sw.FlushAsync(); sw.Close(); fs.Close(); if (LyricShow.IsOpenDeskLyric == false) { deskLyricWin = new DeskLyricWin(); deskLyricWin.Show(); LyricShow.openDeskLyric(deskLyricWin.textBlockDeskLyricFore, deskLyricWin.textBlockDeskLyricBack, deskLyricWin.canvasDeskLyricFore); LyricShow.HB = 204; LyricShow.HG = 122; LyricShow.HR = 0; LyricShow.CB = 193; LyricShow.CG = 180; LyricShow.CR = 180; } LyricShow.IsPauseLyricShow = false; getLT.getLyricAndLyricTimeByLyricPath(AppDomain.CurrentDomain.BaseDirectory + $@"MusicCache/{i}.lrc"); LyricShow.initializeLyricUI(getLT.LyricAndTimeDictionary);//解析歌词->得到歌词时间和歌词 } else { deskLyricWin.Close(); LyricShow.backInitial(); LyricShow.initializeLyricUI(null); LyricShow.IsPauseLyricShow = true; } } else { if (LyricShow.IsOpenDeskLyric == false) { deskLyricWin = new DeskLyricWin(); deskLyricWin.Show(); LyricShow.openDeskLyric(deskLyricWin.textBlockDeskLyricFore, deskLyricWin.textBlockDeskLyricBack, deskLyricWin.canvasDeskLyricFore); LyricShow.HB = 204; LyricShow.HG = 122; LyricShow.HR = 0; LyricShow.CB = 193; LyricShow.CG = 180; LyricShow.CR = 180; } LyricShow.IsPauseLyricShow = false; getLT.getLyricAndLyricTimeByLyricPath(AppDomain.CurrentDomain.BaseDirectory + $@"MusicCache/{textBlock1.Text}.lrc"); LyricShow.initializeLyricUI(getLT.LyricAndTimeDictionary);//解析歌词->得到歌词时间和歌词 } } // } // catch { deskLyricWin.Close(); LyricShow.backInitial(); LyricShow.initializeLyricUI(null); LyricShow.IsPauseLyricShow = true; } }