110,532
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Collections.Specialized;
namespace CMD_POST
{
class Program
{
String Url = ""; //提交的网址
String username = ""; //提交的用户名
String password = ""; //提交的密码
String Speacl = ""; //用来保存特殊特征码字符串
static void Main(string[] args)
{
Program p = new Program();
p.Welcome_Word();
Console.WriteLine();
Console.Write("请输入您的提交网址 (请带上 http:// ) : ");
p.Url = Console.ReadLine();
Console.Write("请输入您的特殊字符 (其中请不要包含特殊字符): ");
p.Speacl = Console.ReadLine();
Console.Write("请输入您的用户名: ");
p.username = Console.ReadLine();
Console.Write("请输入您的密 码: ");
p.password = Console.ReadLine();
p.GetResult();
}
//欢迎词
public void Welcome_Word()
{
Console.WriteLine("************* 欢迎使用C# POST 提交器 *************");
Console.WriteLine();
Console.WriteLine(" 作者:剑走偏锋 [E.S.T] ");
Console.WriteLine();
Console.WriteLine("************* 请输入如下数据 *************");
}
//创建对象
public void GetResult()
{
WebClient web = new WebClient();
NameValueCollection vc = new NameValueCollection();
vc.Add("username", this.username);
vc.Add("password",this.password);
String ReturnMess = "";
int i = 0;
try
{
byte[] byRemoteInfo = web.UploadValues(this.Url,"POST",vc);
ReturnMess = Encoding.UTF8.GetString(byRemoteInfo);
for (i = 0 ; i < ReturnMess.Length ; i++)
{
if (ReturnMess.IndexOf(this.Speacl) > 0)
{
Console.WriteLine("密码找到了!");
Console.WriteLine("帐户:" + this.username + " 密码:" + this.password);
break;
}
//Length += 9;
}
Console.ReadLine();
}
catch (Exception ex)
{
Console.WriteLine("出现错误 : 请检查您所输入的信息是否正确......");
}
}
}
}
如果需要实例 请来找我
必须首先给分结贴!!!
QQ:250623008
邮箱:umbrella_yang@jinpai.com