c#编写QQ群发器(源码)

上传人:豆浆 文档编号:36330108 上传时间:2018-03-27 格式:PDF 页数:6 大小:82.24KB
返回 下载 相关 举报
c#编写QQ群发器(源码)_第1页
第1页 / 共6页
c#编写QQ群发器(源码)_第2页
第2页 / 共6页
c#编写QQ群发器(源码)_第3页
第3页 / 共6页
c#编写QQ群发器(源码)_第4页
第4页 / 共6页
c#编写QQ群发器(源码)_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《c#编写QQ群发器(源码)》由会员分享,可在线阅读,更多相关《c#编写QQ群发器(源码)(6页珍藏版)》请在金锄头文库上搜索。

1、qq系列之c#编写QQ群发器 疯狂代码 http:/www.CrazyC : http:/www.CrazyC 使用C#实现qq群发器的方法1、窗体引用两个timer控件,来控循环发送时间 2、调试环境 程序代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Runtime.Intero

2、pServices; using System.Diagnostics; namespace CrazyCoder.QQ.QQSendMessage public partial class QQSendMessage : Form DllImport( “user32.dll “) static extern IntPtr FindWindow(string lpClassName, string lpWindowName); DllImport( “user32.dll “) static extern IntPtr GetDlgItem(IntPtr hDlg, int nIDDlgIt

3、em); DllImport( “user32.dll “, SetLastError = true) public static extern IntPtr FindWindowEx(IntPtr parentHandle, int childAfter, string className, int windowTitle); DllImport( “user32.dll “, EntryPoint = “SendMessage “) static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, string lPar

4、am); DllImport( “kernel32.dll “, CharSet = CharSet.Auto) public static extern IntPtr GetModuleHandle(string lpModuleName); IntPtr hwndQQ; IntPtr hwnd1; IntPtr hwnd2; IntPtr hwnd3; IntPtr hwnd4; public QQSendMessage() InitializeComponent(); * void MySendMessage() string machinename = System.Environme

5、nt.MachineName;/获得计算机名 Process processlist = Process.GetProcesses(machinename);/得到所有进程 foreach (Process p in processlist)/列举每个进程 if (p.MainWindowTitle != “ “)/标题是否为空,不为空执行下面代码 if (p.MainWindowTitle.ToString().Substring(0, 1) = “与 “)/查看窗口标题第一个字是否是“与”。如果是 的,说明是QQ窗口 hwndQQ = FindWindow( “#32770 “, p.Ma

6、inWindowTitle.ToString(); hwnd1 = GetDlgItem(hwndQQ, 0); hwnd2 = GetDlgItem(hwnd1, 0); hwnd3 = GetDlgItem(hwnd2, 894); SendMessage(hwnd3, 194, 0, this.txtInput.Text);/向QQ输入框粘贴字符,this.textBox1.Text是要发送的文 字信息 hwnd4 = GetDlgItem(hwnd1, 1); SendMessage(hwnd4, 245, 0, Convert.ToString(0); / / 单个用户发送消息 /

7、/ / * void btnSend_Click(object sender, EventArgs e) MySendMessage();/发送信息,向单个用户发送。 / / 循环发送消息 / / / * void btnSSend_Click(object sender, EventArgs e) this.Qtimer.Enabled = true; / / 停止发送消息 / / / * void btnSStop_Click(object sender, EventArgs e) this.Qtimer.Enabled = false; / / 计时器开始发送消息 / / / * voi

8、d Qtimer_Tick(object sender, EventArgs e) this.MySendMessage(); * void QunSendMessage()/针对群的消息发送过程 string machinename = System.Environment.MachineName; Process processlist = Process.GetProcesses(machinename); foreach (Process p in processlist) if (p.MainWindowTitle != “ “) if (p.MainWindowTitle.ToSt

9、ring().Substring(p.MainWindowTitle.Length - 1, 1) = “群 “) hwndQQ = FindWindow( “#32770 “, p.MainWindowTitle.ToString(); hwnd1 = GetDlgItem(hwndQQ, 0); hwnd2 = GetDlgItem(hwnd1, 0); hwnd3 = GetDlgItem(hwnd2, 894); SendMessage(hwnd3, 194, 0, this.txtGInput.Text);/向QQ输入框粘贴字符 hwnd4 = GetDlgItem(hwnd1, 1

10、); SendMessage(hwnd4, 245, 0, Convert.ToString(0); / / 向群组发消息 / / / * void btnGXSend_Click(object sender, EventArgs e) this.QunSendMessage();/向群发送单条信息 / / 循环向群组发送消息 / / / * void btnGSend_Click(object sender, EventArgs e) this.QGtimer.Enabled = true; / / 停止向群组发送消息 / / / * void btnGStop_Click(object s

11、ender, EventArgs e) this.QGtimer.Enabled = false; / / 计时器发送消息 / / / * void QGtimer_Tick(object sender, EventArgs e) this.QunSendMessage();/连续发送信息,多少秒发送一次,自己设定。 / / 利用tencent协议,打开临时对话框 ; / / / * void btnQQ_Click(object sender, EventArgs e) string s = “tencent:/message/?uin= “ + this.txtQQ.Text + “/是对方的 QQ号 比如疯狂代码和傲博知识库的qq Process.Start(s); / / 初始化窗体 / / / * void QQSendMessage_Load(object sender, EventArgs e) this.txtGms.Text = “1000 “; this.txtMs.Text = “1000 “; 2008-9-21 0:14:02 疯狂代码 http:/www.CrazyC

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号