-
Notifications
You must be signed in to change notification settings - Fork 6
/
Form1.cs
67 lines (63 loc) · 2.26 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DotNet.Utilities;
namespace KanColleJehad
{
public partial class Form1 : Form
{
int total_num = 0;
public Form1()
{
InitializeComponent();
}
private void btn_start_Click(object sender, EventArgs e)
{
if (ckb_agreement.Checked == false)
{
MessageBox.Show("未同意协议,不能使用");
}
else
{
ckb_agreement.Enabled = false;
tmr_send.Interval = (int)numericUpDown1.Value;
tmr_send.Enabled = true;
}
}
private void btn_stop_Click(object sender, EventArgs e)
{
ckb_agreement.Enabled = true;
tmr_send.Enabled = false;
}
private void tmr_send_Tick(object sender, EventArgs e)
{
Random ran = new Random();
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "http://www.moejn.com/login.html",
Method = "POST",
Timeout = 100000,
ReadWriteTimeout = 30000,
IsToLower = false,
Cookie = txt_cookie.Text,
UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0",
Accept = "text/html, application/xhtml+xml, */*",
ContentType = "application/x-www-form-urlencoded",
Referer = "http://www.moejn.com/login.html",
Postdata = "name="+ran.Next()+"&password="+ran.Next()+"&world=1&seccode="+txt_scd.Text+"®istersubmit=%E6%8F%90%E4%BA%A4",
//ResultType = ResultType.String,//返回数据类型,是Byte还是String
};
HttpResult result = http.GetHtml(item);
string html = result.Html;
string cookie = result.Cookie;
byte[] b = result.ResultByte;
total_num++;
lbl_num.Text = "已发送:" +total_num+ "次";
}
}
}