如何利用C#批量注册QQ邮箱 - 伍华聪

时间:2024-02-22 14:35:47

如何利用C#批量注册QQ邮箱

在上篇随笔《如何使用C#实现QQ号码的申请》有介绍如何利用C#实现QQ号码的批量申请功能,其实腾讯还提供了一个注册QQ邮箱伴随有QQ号码的注册方式,就是QQ邮箱的注册,QQ邮箱的批量注册,在很多场合需要用到,如注册淘宝账号,或者用来发送邮件,做营销加群,然后发送群邮件等等操作,注册QQ邮箱的界面如下图所示:

 

相对来说,QQ邮件的注册会比较容易一些,腾讯没有那么多变态古怪的加密处理方式,是比较正常的POST操作处理。

关键申请代码如下所示:

            postData.AppendFormat("email={0}&nick={0}", randomUser, randomUser.Length > 10 ? randomUser.Substring(10) : randomUser);
            postData.AppendFormat(
"&age=1993&age_month=8&age_day=23&regsex=1");
            postData.AppendFormat(
"&password_1={0}&password_2={0}", qqDefaultPass);
            postData.AppendFormat(
"&Country=6&State=26&City=7");
            postData.AppendFormat(
"&validecode={0}&regqqmail=1&asdfg={1}&"this.txtVerifyCode.Text, asdfg);

            
string tempUrl = "http://emailreg.qq.com/cgi-bin/signup/srv_tj?type=54796&seed=0." + GetRandomNumber();
            
string temp = httpHelper.GetHtml(tempUrl, cookieReg, tempUrl);
            Thread.Sleep(
100);

            
string content = httpHelper.GetHtml(postUrl, cookieReg, postData.ToString(), true, refer);
            
if (content.Contains("恭喜您,申请成功"))
            {
                
string qq = httpHelper.GetHiddenKeyValue(content, "uin");

                re 
= new Regex("您申请的Email帐号为:<strong>(?<email>.*?)</strong>", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace);
                mc 
= re.Match(content);
                
string email = "";
                
if (mc.Success)
                {
                    email 
= mc.Groups[1].Value;
                }

                SuccessCount
++;//成功计数
                AddToList(string.Format("qq:{0} email:{1}", qq, email));
                SetTips(
string.Format("恭喜您,申请到QQ邮件:{0} Email:{1}", qq, email));

                
int redialCount = Convert.ToInt32(this.txtReDailCount.Value);
                
if (redialCount > 0 && (SuccessCount % redialCount == 0))
                {
                    btnRedail_Click(
nullnull);//重新拨号
                }
            }
            
else
            {
                
string error = "申请失败,请重试";
                
if (content.IndexOf("此IP申请的操作过于频繁"> 0)
                {
                    error 
= "此IP申请的操作过于频繁";
                }
                
else if (content.IndexOf("验证码错误"> 0)
                {
                    error 
= "验证码错误";
                }
                SetTips(error);
            }

 

软件实现的效果如下所示:

 

 

腾讯一般一天一个IP只是允许注册几个号码,如果太过频繁,容易被*一段时间,这个时候,就可以利用快速拨号方式,重新更换IP地址,然后又是好汉一条,非常酷爽,哈哈。