嗨,我正在使用此代码来使我的程序检查器<并且此代码工作得很好<,但是在检查器中我是10个用户名之后,响应使我感到失望,而在我等待了2分钟后,休息检查器使我获得了良好的响应 我需要帮助什么问题 如果在回复失败后使用vpn,请让我重新检查并获得良好的回复 我认为服务器让我阻塞了我的IP几分钟,然后再次工作 我需要检查不止1000个用户名,或者每天获取我
This is a first request and response It is a good not have any problem
After check maybe 10 username get me this response I don't know what is the problem
namespace PSNChecker
{
class Program
{
//Class for the POST request
class PSNRequest
{
public string onlineId;
public bool reserveIfAvailable = false;
}
static void Main(string[] args)
{
Console.Title = "PSN Username Checker ";
if (args.Length == 0)
{
Console.WriteLine("HOLD UP! Invalid parameters passed.");
Console.WriteLine(":");
Console.WriteLine("");
Console.WriteLine("");
Console.ReadKey();
return;
}
int im_good = 0, dat_boi_o_shit = 0;
List<string> valid = new List<string>();
using (StreamReader r = new StreamReader(args[0]))
{
string line;
while ((line = r.ReadLine()) != null)
{
var output = Check(line);
if (output == null)
{
Console.WriteLine("{0} -> VALID", line);
im_good++;
valid.Add(line);
}
else
{
dynamic resp = JsonConvert.DeserializeObject(output);
string msg = resp[0].validationErrors[0].message;
Console.WriteLine("{0} -> {1}", line, msg.Split('.')[0]);
}
dat_boi_o_shit++;
}
}
Console.WriteLine("Finished validating names. {0}/{1} names were valid.", im_good, dat_boi_o_shit);
if (args.Length == 2)
{
File.WriteAllLines(args[1], valid.ToArray());
Console.WriteLine("Output valid PSN names to {0}", args[1]);
}
}
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("HERE MY URL");
req.KeepAlive = false;
req.ContentType = "application/json";
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
req.Method = WebRequestMethods.Http.Post;
PSNRequest o = new PSNRequest();
o.onlineId = PSN;
string json = JsonConvert.SerializeObject(o);
using (var streamWriter = new StreamWriter(req.GetRequestStream()))
{
streamWriter.Write(json);
}
try
{
var resp = (HttpWebResponse)req.GetResponse();
//Otherwise it just outputs an empty JSON object.
return null;
}
catch (WebException e)
{
exception this time so we can at least get the response body.
using (WebResponse resp = e.Response)
{
using (var reader = new StreamReader(resp.GetResponseStream()))
{
return reader.ReadToEnd();
}
}
}
}
}
}