苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 54052|回复: 40
打印 上一主题 下一主题

[源码分享] 网易163邮箱post注册机

[复制链接]
跳转到指定楼层
发表于 2014-2-2 23:33:18 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 Firefly1992 于 2014-7-18 14:10 编辑

前几天有个软件需要大批邮箱,想想可是一个个注册太麻烦了。经过一个星期的研究,写了这个程序,虽然还是很麻烦,不过比起网页上注册已经够方便的了。只需要填写验证码,用户名都不用考虑,直接生成可用的随即字符串。
在此分享给大家,大家看看有什么需要改进的地方可以回复我哦~
ps:没有加入代理服务器,不知道加入后程序运行会不会很慢啊。而且代理服务器怎么测试?如果不能用怎么办?没有接触过这方面的东西,苏大大能给讲一下吗?
本程序基于苏飞的HttpHelper。
在此只贴部分主要代码了。
首次登陆
[C#] 纯文本查看 复制代码
public bool MainPageLoad()
        {
            HttpHelper http = new HttpHelper();
            HttpItem item = new HttpItem()
            {
                URL = Webroot + "?cmd=register.entrance&from=163mail",
                Method = "get",
                Cookie = this.Cookie,
                ContentType = "application/x-www-form-urlencoded",
            };
            HttpResult result = http.GetHtml(item);
            string retMsg = result.Html;
            this.Cookie = result.Cookie;
            this.Envalue = retMsg.Substring(retMsg.IndexOf("envalue") + 11, 6);
            return true;
        }


保持会话
[C#] 纯文本查看 复制代码
public bool CreateSSL()
        {
            HttpHelper http = new HttpHelper();
            HttpItem item = new HttpItem()
            {
                URL = String.Format("https://ssl.mail.163.com/regall/unireg/prepare.jsp?sid={0}&sd={1}", this.JsessionID, this.ser_adapter),
                Method = "get",
                Cookie = this.Cookie,
                KeepAlive = true,
                ContentType = "application/x-www-form-urlencoded",
            };
            HttpResult result = http.GetHtml(item);
            string retMsg = result.Html;
            //返回5个回车
            if (retMsg == @"



")
                return true;
            return false;
        }


获取验证码
[C#] 纯文本查看 复制代码
public Image getvCode(bool type)
        {
            string env = JScript.env(this.Envalue).ToString();
            string t = JScript.getTime().ToString();
            string Url = Webroot;
            if (type)
                Url += String.Format("?cmd=register.verifyCode&v=common/verifycode/vc_en&env={0}&t={1}", env, t);
            else
                Url += String.Format("?cmd=register.verifyCode&v=common/verifycode/vc_zh&vt=grey&env={0}&t={1}", env, t);
            HttpHelper http = new HttpHelper();
            HttpItem item = new HttpItem()
            {
                URL = Url,
                Method = "get",
                ResultType = ResultType.Byte,
                ContentType = "application/x-www-form-urlencoded",
            };
            HttpResult result = http.GetHtml(item);
            Image img = byteArrayToImage(result.ResultByte);
            return img;
        }


提交数据
[C#] 纯文本查看 复制代码
public string Submit(string password, string vcode)
        {
            HttpHelper http = new HttpHelper();
            HttpItem item = new HttpItem()
            {
                URL = String.Format("https://ssl.mail.163.com/regall/unireg/call.do;jsessionid={0}?cmd=register.start", this.JsessionID),
                Method = "POST",
                ContentType = "application/x-www-form-urlencoded",
                Postdata = String.Format("name={0}&flow=main&uid={0}%40163.com&password={1}&confirmPassword={1}&mobile=&vcode={2}&from=163mail", this.Name, password, vcode),
            };
            HttpResult result = http.GetHtml(item);
            string retMsg = result.Html;
            return retMsg;
        }


二次验证
[C#] 纯文本查看 复制代码
public string Resume(string code)
        {
            HttpHelper http = new HttpHelper();
            HttpItem item = new HttpItem()
            {
                URL = Webroot + "?cmd=register.resume",
                Method = "POST",
                ContentType = "application/x-www-form-urlencoded",
                Postdata = String.Format("vcode={0}&uid={1}%40163.com&suspendId={2}", ConvertToUtf8(code), this.Name, this.SuspendID),
                Cookie = this.Cookie,
            };
            HttpResult result = http.GetHtml(item);
            string retMsg = result.Html;
            return retMsg;
        }


程序下载地址

重新更正了下载地址,谢谢大家支持。

http://www.sufeinet.com/forum.php?mod=attachment&aid=MzYyMnw4MGZjOTg0NWFlZDFiZjUzZjQ4YTcwNzQwYTU3Y2E4YXwxNzYwNDY0NjY5&request=yes&_f=.rar


本帖被以下淘专辑推荐:



1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
推荐
发表于 2014-2-3 16:45:53 | 只看该作者
用代理的话,注册效率会高很多
39
发表于 2015-5-7 15:37:49 | 只看该作者
多谢分享,拿去研究一下~!!
38
 楼主| 发表于 2014-12-22 13:22:46 | 只看该作者
hobby666 发表于 2014-11-28 23:17
【错误        1        类型“Microsoft.JScript.INeedEngine”在未被引用的程序集中定义。必须添加对程序集“Microsoft. ...

js.dll这个文件你引用了吗?
37
 楼主| 发表于 2014-12-22 13:19:50 | 只看该作者
zgy0209zgy 发表于 2014-8-11 11:38
好像出错次数多后软件启动不起来。

那是因为没有加入IP代理,同一个ip访问次数过多,网易那边会检测的。
36
 楼主| 发表于 2014-12-22 13:19:10 | 只看该作者
speed2018 发表于 2014-8-6 13:50
东西很好用,能不能给个工程文件呢

自己重建一下不就好了。
35
发表于 2014-11-28 23:17:44 | 只看该作者
【错误        1        类型“Microsoft.JScript.INeedEngine”在未被引用的程序集中定义。必须添加对程序集“Microsoft.JScript, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”的引用。        c:\users\hobby9\documents\visual studio 2010\Projects\Mail163\Mail163\Mail.cs        138        13        Mail163】


新建了一个工程,导入了所有的文件,dll也引用了,还提示这个错误呢,请问老大怎么解决呢?谢谢
34
发表于 2014-8-27 23:46:34 | 只看该作者
强烈支持楼主ing……
33
发表于 2014-8-15 10:27:32 | 只看该作者
受教了,学习中……

这个真心的不错。。
32
发表于 2014-8-11 11:38:42 | 只看该作者
好像出错次数多后软件启动不起来。
31
发表于 2014-8-6 13:50:35 | 只看该作者
东西很好用,能不能给个工程文件呢
30
发表于 2014-8-3 00:57:44 | 只看该作者
强烈支持楼主。。。。
您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2025-10-15 01:57

© 2014-2021

快速回复 返回顶部 返回列表