0){handlerAbc(null,null);return;}//模拟点击"最近访客"varaa=pagediv.Parent.Parent.FirstChild.Children[2];aa.InvokeMember("click");//给访问列表的容器绑定一个事件...回调时就能获取到.HtmlElementguestlist=pagediv.Parent.FirstChild;//ul.RaiseEventguestlist.AttachEventHandler("onpropertychange",newEventHandler(handlerAbc));}privatevoidhandlerAbc(Objectsender,EventArgse){HtmlElementdiv=wb1.Document.GetElementById("visitor_list_page_con");HtmlElementguestlist=div.Parent.FirstChild;if(guestlist.InnerHtml.IndexOf("QZONE.FrontPage.showLoginBox")>-1){HtmlElementalogin=guestlist.GetElementsByTagName("a")[0];alogin.InvokeMember("click");//使用定时器.检测登录窗口的出现..terAutologin.Start();return;}else{System.Text.StringBuildersb=newStringBuilder();//取回里面的内容?foreach(HtmlElementliinguestlist.Children){stringqq=li.GetAttribute("uin");stringvisitname=li.Children[1].FirstChild.InnerText;stringvisittime=li.Children[1].Children[1].InnerText;sb.AppendLine(qqvisitnamevisittime);}MessageBox.Show(sb.ToString());}}}}-IMDN开发者社群-imdn.cn"> 0){handlerAbc(null,null);return;}//模拟点击"最近访客"varaa=pagediv.Parent.Parent.FirstChild.Children[2];aa.InvokeMember("click");//给访问列表的容器绑定一个事件...回调时就能获取到.HtmlElementguestlist=pagediv.Parent.FirstChild;//ul.RaiseEventguestlist.AttachEventHandler("onpropertychange",newEventHandler(handlerAbc));}privatevoidhandlerAbc(Objectsender,EventArgse){HtmlElementdiv=wb1.Document.GetElementById("visitor_list_page_con");HtmlElementguestlist=div.Parent.FirstChild;if(guestlist.InnerHtml.IndexOf("QZONE.FrontPage.showLoginBox")>-1){HtmlElementalogin=guestlist.GetElementsByTagName("a")[0];alogin.InvokeMember("click");//使用定时器.检测登录窗口的出现..terAutologin.Start();return;}else{System.Text.StringBuildersb=newStringBuilder();//取回里面的内容?foreach(HtmlElementliinguestlist.Children){stringqq=li.GetAttribute("uin");stringvisitname=li.Children[1].FirstChild.InnerText;stringvisittime=li.Children[1].Children[1].InnerText;sb.AppendLine(qqvisitnamevisittime);}MessageBox.Show(sb.ToString());}}}} - IMDN开发者社群-imdn.cn">
登录
首页 » C# » 自动登录qq空间,获取最近访客列表.

自动登录qq空间,获取最近访客列表.

于 2014-04-18 发布
0 252
下载积分: 1 下载次数: 0

代码说明:

自动登录qq空间,获取最近访客列表.using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace WindowsFormsApplication1{ public partial class Form1 : Form { Timer terAutologin = new Timer(); public Form1() { InitializeComponent(); terAutologin.Enabled = true; terAutologin.Interval = 3 * 1000; terAutologin.Tick = ter_Tick; } void ter_Tick(object sender, EventArgs e) { if(wb1.Document==null) { return; } HtmlElement dialog_content_1 = wb1.Document.GetElementById("dialog_content_1"); if (dialog_content_1 == null) { return; } var frame = wb1.Document.Window.Frames[0]; if (frame==null) { return; } if (frame.Document==null) { return; } // iframe HtmlElement u = frame.Document.GetElementById("u"); u.InnerText = "171586098"; HtmlElement p = frame.Document.GetElementById("p"); p.InnerText = "*************"; p.SetAttribute("value", "********"); HtmlElement login_button = frame.Document.GetElementById("login_button"); login_button.InvokeMember("click"); terAutologin.Stop(); } private void Form1_Load(object sender, EventArgs e) { ssl1.Text = string.Empty; txtUrl.Text = "http://user.qzone.qq.com/14371939"; wb1.ScriptErrorsSuppressed = true; wb1.Navigate("http://user.qzone.qq.com/14371939/main"); } private void btnGO_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtUrl.Text)) { wb1.Navigate(txtUrl.Text); ssl1.Text = txtUrl.Text " Navigated"; } } private void wb1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { System.Diagnostics.Trace.WriteLine(e.Url.ToString()); // http://g.cnc.qzone.qq.com/cgi-bin/friendshow/cgi_get_visitor_simple?uin=4371939&type=1&mask=3&rd=0.7801240284461528&_=1397644130601&g_tk=9281770 ssl1.Text = e.Url.ToString() " Completed"; tryRead(); } private void btnTest_Click(object sender, EventArgs e) { tryRead(); } private void tryRead() { if (wb1.Document == null) { return; } HtmlElement pagediv = wb1.Document.GetElementById("visitor_list_page_con"); if (pagediv==null) { return; } //若分页内容存在,则表示已经加载过了. if(pagediv.Children.Count>0) { handlerAbc(null,null); return; } //模拟点击 "最近访客" var aa = pagediv.Parent.Parent.FirstChild.Children[2]; aa.InvokeMember("click"); //给访问列表的容器绑定一个事件...回调时就能获取到. HtmlElement guestlist = pagediv.Parent.FirstChild; //ul.RaiseEvent guestlist.AttachEventHandler("onpropertychange", new EventHandler(handlerAbc)); } private void handlerAbc(Object sender, EventArgs e) { HtmlElement div = wb1.Document.GetElementById("visitor_list_page_con"); HtmlElement guestlist = div.Parent.FirstChild; if (guestlist.InnerHtml.IndexOf("QZONE.FrontPage.showLoginBox") > -1) { HtmlElement alogin = guestlist.GetElementsByTagName("a")[0]; alogin.InvokeMember("click"); // 使用定时器.检测登录窗口的出现.. terAutologin.Start(); return; } else { System.Text.StringBuilder sb = new StringBuilder(); // 取回里面的内容? foreach (HtmlElement li in guestlist.Children) { string qq = li.GetAttribute("uin"); string visitname = li.Children[1].FirstChild.InnerText; string visittime = li.Children[1].Children[1].InnerText; sb.AppendLine(qq visitname visittime); } MessageBox.Show(sb.ToString()); } } }}

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • DDD架构面向领域驱动开发模式
    DDD架构面向领域驱动开发模式
    2015-01-04下载
    积分:1
  • 通讯录管理系统 sqlserver 数据库
    c#通讯录管理 数据库连接自己修改,图片有些是本地需要自己手动修改
    2019-05-20下载
    积分:1
  • C# 批量重命名文件 实例源码下载
    C# 批量重命名文件 实例源码下载
    2013-09-20下载
    积分:1
  • 用Ninject 实现webapi ApiController 示例源码
    用Ninject 实现webapi ApiController 示例源码
    2014-06-07下载
    积分:1
  • 自定义水晶按钮控件--示例源码下载.zip
    自定义水晶按钮控件--示例源码下载.zip
    2019-08-08下载
    积分:1
  • .NET Reflector 5.0 使用例子(反编译软件)
    .NET Reflector 5.0 Release Notes 28 December 2006 Reflector is a class browser for .NET components. It allows browsing and searching the meta data, IL instructions, resources and XML documentation stored in a .NET assembly. Reflector was first released in October 2000 running on .NET Framework 1.0 Beta. LINQ and .NET Framework 3.5: Reflector supports query expressions and other concepts introduced in C# 3.5. To enable this feature select ".NET 3.5" under View, Options, Disassembler, Optimization. .NET Framework compatibility: Reflector runs on all versions of the .NET Framework using its own assembly loading infrastructure which does not rely on the Reflection API. For example, Reflector can load .NET Framework 2.0 assemblies without having the .NET Framework 2.0 installed. Assembly Lists: When launched for the first time, Reflector allows you to choose a default set of assemblies. The list of assemblies is then stored in the Reflector.cfg file and will be loaded next time you open the program. Reflector allows creating multiple assembly lists and switching between the lists using the File, Open List dialog. To choose a different set of default assemblies for the current assembly list you should remove all assemblies from the list (DEL) and invoke the Refresh command (F5). Assembly Cache: When resolving an assembly reference, Reflector will first search the local path next to the assembly holding the reference and then falls back to the cache directories defined in the Reflector.cfg file. Reflector does not search the Global Assembly Cache (GAC) unless you add "%SystemRoot%Assembly" to the cache directories list. Assembly Versioning: By default, assembly version numbers are ignored when resolving type and member references. You can enable side-by-side versioning in the options dialog but it is suggested to avoid this if possible. Add-Ins: Information about the Reflector add-in model can be found here. The most recent version of .NET Reflector is available here. Disclaimer: This software is provided "AS IS" with no warranties of any kind. The entire risk arising out of the use or performance of the software is with you.
    2015-06-15下载
    积分:1
  • c# 断点续传 示例源码
    c# 断点续传 示例源码
    2014-03-22下载
    积分:1
  • C primer Plus 练习答案.pdf
    【实例简介】C Primer Plus第6版编程练习答案.rar
    2021-06-02 00:31:08下载
    积分:1
  • C#和欧姆龙PLC通信程序
    欧姆龙以太网FINS协议的C#通讯库
    2019-07-05下载
    积分:1
  • 一卡通过管理系统
    【实例简介】一卡通过管理系统
    2021-11-30 00:45:53下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载