using System;
using System.Configuration;
using System.IO;
using System.Net;
using System.Text;
namespace AutoVote
{
class Program
{
static void Main(string[] args)
{
long id = long.Parse(ConfigurationManager.AppSettings["id"]);
long phone = 13000000000;
int count = 0;
for (int i = 0; i < 1000; i++)
{
id++;
phone++;
VoteById(id, phone, ref count);
}
Console.WriteLine(string.Format("成功投票{0}张", count));
}
private static void VoteById(long id, long phone, ref int count)
{
//SelectID1=11&
string data = string.Format("SelectID4=47&dh={1}&sfz={0}&submitLogin.x=67&submitLogin.y=7", id, phone);
byte[] requestBuffer = System.Text.Encoding.GetEncoding("gb2312").GetBytes(data);
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("http://www.ntradio.net/sqtp/vote_doIpzuo.asp");
request.Method = "POST";
request.Headers.Add(HttpRequestHeader.Cookie, "ASPSESSIONIDQQSRBATB=PBJGAFHCKNGJOFDJDBPEGNPG;");
request.Referer = "http://www.ntradio.net/sqtp/indexzuo.asp";
request.ContentLength = requestBuffer.Length;
request.ContentType = "application/x-www-form-urlencoded";
request.UserAgent = "Mozilla/5.0";
request.UseDefaultCredentials = true;
using (Stream requestStream = request.GetRequestStream())
{
requestStream.Write(requestBuffer, 0, requestBuffer.Length);
requestStream.Flush();
requestStream.Close();
}
WebResponse response = request.GetResponse();
StringBuilder sb = new StringBuilder();
using (StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding("gb2312")))
{
string str = reader.ReadToEnd();
sb.Append(str);
reader.Close();
}
if (sb.ToString().Contains("恭喜您"))
{
count += 1;
System.Console.WriteLine("成功投票" + count.ToString());
}
}
}
}
RSS
Facebook
twitter