申请会员ID:jacklp【申请通过】
1、申 请 I D :jacklp2、个人邮箱:jacklp1@qq.com
3、原创技术文章: 偶然发现草榴在发码 立即写了一个抢码软件,并能自动注册;为了抓紧时间 功能简单;由于已经抢到3个,所以,功能也就没去完善
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
webBrowser1.Navigate("http://ruai.lesile.net/register.php");
}
/// <summary>
/// 获取编码格式
/// </summary>
/// <param name="response"></param>
/// <returns></returns>
public Encoding GetEncoding(HttpWebResponse response)
{
Encoding code = Encoding.Default;
string charset = null;
//如果发现content-type头
string ctypeLower = response.Headers["content-type"];
string ctypeOrder = response.Headers["Content-Type"];
string ctype = "";
if (!ctypeLower.Equals(""))
ctype = ctypeLower;
if (!ctypeOrder.Equals(""))
ctype = ctypeOrder;
//Console.WriteLine("ctype:" + ctype);
if (ctype != null)
{
int ind = ctype.IndexOf("charset=");
if (ind != -1)
{
charset = ctype.ToLower().Substring(ind + 8);
}
}
Console.WriteLine("charset编码格式:" + charset);
if (charset != "")
{
try
{
code = Encoding.GetEncoding(charset);
}
catch { }
}
return code;
}
/// <summary>
/// GET URL
/// </summary>
/// <param name="Url"></param>
/// <returns></returns>
private string GetWebContent(string Url)
{
start:
try
{
string strResult = "";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url);
//声明一个HttpWebRequest请求
request.Timeout = 10000;
//设置连接超时时间
request.Headers.Set("Pragma", "no-cache");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream streamReceive = response.GetResponseStream();
Encoding encoding = GetEncoding(response);//取得要取得的网页的编码方式
//Encoding encoding = Encoding.GetEncoding("utf-8");
StreamReader streamReader = new StreamReader(streamReceive, encoding);
strResult = streamReader.ReadToEnd();
return strResult;
}
catch
{
goto start;
}
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
}
public string strWeb;
private static string Url = "http://ruai.lesile.net/htm_data/7/1410/1257255.html";
string str = "";
private string strWebContent;
private int iLastStart;
private int iStart;
private int iEnd;
private void reCAOLIU()
{
REtry:
try
{
//得到指定Url的源码
strWebContent = GetWebContent(Url);
//webBrowser2.DocumentText = strWebContent;
iLastStart = strWebContent.IndexOf("第五批", 0);
if (iLastStart == -1)
{
return;
}//获取邀请码
iStart = strWebContent.IndexOf("<br>", iLastStart + 50);
iEnd = strWebContent.IndexOf("<br>", iStart + 6);
strWeb = strWebContent.Substring(iStart + 4, iEnd - iStart - 4);
textBox2.Text = strWeb;
label1.Text = DateTime.Now.TimeOfDay.ToString();
timer1.Enabled = false;
HtmlElement regname = webBrowser1.Document.GetElementById("regname");
HtmlElement regpwd = webBrowser1.Document.GetElementById("regpwd");
HtmlElement regpwdrepeat = webBrowser1.Document.GetElementById("regpwdrepeat");
HtmlElement regemail = webBrowser1.Document.GetElementById("regemail");
HtmlElement invcode = webBrowser1.Document.GetElementById("invcode");
//自动填写注册信息
regname.InnerText = "jacklp";
regpwd.InnerText = "123456";
regpwdrepeat.InnerText = "123456";
regemail.InnerText = "jacklp1@qq.com";
invcode.InnerText = strWeb;
HtmlElement submit = webBrowser1.Document.GetElementById("regsubmit");//提交注册
submit.InvokeMember("click");
}
catch
{
goto REtry;
}
}
private void timer1_Tick(object sender, EventArgs e)
{
reCAOLIU();
}
}
ID:jacklp
邮箱:jacklp1@qq.com
申请通过,欢迎光临吾爱破解论坛,期待吾爱破解有你更加精彩,ID和密码自己通过邮件密码找回功能修改,请即时登陆并修改密码!
登陆后请在一周内在此帖报道,否则将删除ID信息。 新人前来报到 欢迎欢迎,{:1_927:} 1024貌似很牛逼的样子,我也想去试试
页:
[1]